wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

class ,objects,variables & methods

Total questions: 25

Worksheet time: 18mins

Name
Class
Date
1.

Java is a

a)

Procedure Oriented Language

b)

Structure Oriented Language

c)

Object Oriented Language

d)

Machine Language

2.

a)

Compiler Error

b)

20

c)

nothing prints

3.

JRE stands for

a)

Java Run Environment

b)

Java Run Execution

c)

Java Runtime Environment

d)

Java Ready Execution

4.

predict the output

a)

area is 25

b)

compile time error due to static methods called in non static method

c)

runtime error

d)

nothing prints

5.
a)

compile time error: static methods must be void only

b)

25

c)

nothing prints

6.

which of the these variables allowed in java.

a)

Local Variables

b)

Instance Variables

c)

Static Variables

d)

All the above

e)

none of the above

7.

a)

compile time error : print() used instead of println()

b)

you are in placement training

c)

"you are in placement training"

8.

what is the extension of the bytecode files in java?

a)

.java

b)

.bytecode

c)

.objectcode

d)

.class

9.

a)

1,2

b)

2,3

c)

1,2,3

d)

1,2,3,4

10.

Which of the following is true?

a)

java uses only interpreter

b)

java uses only compiler

c)

java uses both interpreter and compiler

d)

none of the above

11.
a)

prints hai

b)

nothing prints

c)

compile time error

d)

none of the above

12.

Command to compile Java program

a)

javax

b)

java

c)

javac

d)

javay

13.

predict the output

a)

10

b)

25

c)

10 25

d)

25 10

14.

JDK stands for

a)

Java Developer Kit

b)

Java Development Kit

c)

Java Design Kit

d)

Java Debugging Kit

15.

predict output

a)

10

b)

5

c)

error

16.

System.out.println("hai"+10);

in the above print statement '+' is a

a)

arithmetic operator

b)

concatenation operator

c)

none of the above

17.

At the end of this fragment of code what is r1.count value?

a)

10

b)

-5

c)

6

d)

7

e)

8

18.
a)

sum is 1020

b)

sum is 30

c)

airthmetic error

19.
a)

40

b)

30

c)

20

d)

10

20.

a)

-10

b)

10

c)

error

21.

predict output

a)

Could not find or load main class sample

b)

Could not find or load main class Hai

c)

printed Hai

d)

file name class name must me same

22.
a)

good afternoon

b)

good afternoon

good morning

c)

compile time error

d)

good morning

good afternoon

23.

a)

midday

b)

compile time error

c)

midday

good morning

d)

midday

good afternoon

good morning

24.

a)

midday

b)

compile time error

c)

midday

good morning

d)

midday

good afternoon

good morning

25.

a)

midday

b)

nothing prints

c)

midday

good morning

d)

midday

good afternoon

good morning