wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

JAVA Basics

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

Which of these cannot be used for a variable name in Java?

a)

identifier & keyword

b)

identifier

c)

keyword

d)

none of the mentioned

2.

Which component is used to compile, debug and execute the java programs?

a)

JRE

b)

JIT

c)

JDK

d)

JVM

3.

Which of the following is not an OOPS concept in Java?

a)

Polymorphism

b)

Compilation

c)

Inheritance

d)

Encapsulation

4.

Which of these are selection statements in Java?

a)

break

b)

continue

c)

for()

d)

if()

5.

What is the value stored in x in following lines of code?

int x, y, z;

 x = 0;

 y = 1;

 x = y = z = 8;

a)

1

b)

9

c)

8

d)

0

6.

Evaluate the following Java expression, if x=3, y=5, and z=10:

++z + y - y + z + x++

a)

24

b)

23

c)

20

d)

25

7.

Which of the following for loop declaration is not valid?

a)

for ( int i = 99; i >= 0; i / 9 )

b)

for ( int i = 7; i <= 77; i += 7 )

c)

for ( int i = 20; i >= 2; - -i )

d)

for ( int i = 2; i <= 20; i = 2* i )

8.

What does JVM stands for?

a)

Java Variable Machine

b)

Java Virtual Machine

c)

Java Virtual Mechanism

d)

None of the above

9.

What are the main Distribution types of Java Software?

a)

Java SE (Java Standard Edition)

b)

Java EE (Java Enterprise Edition)

c)

Java ME (Java Micro Edition)

d)

All the above

10.

What is JVM ?

a)

JVM is the confined memory area

b)

All java programs run inside JVM memory

c)

JVM provides security to the computer by giving controlled access to Files and Memory on a computer

d)

All the above