wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

QUIZ FINAL JAVA_TOPGUN14

Total questions: 25

Worksheet time: 25mins

Name
Class
Date
1.
a)

     a, c, d

b)

     b, c

c)

      c, d

d)

None of above

2.
a)

      public class default{}

b)

      protected inner class Test{}

c)

     final class Test{}

d)

     None of above.

3.
a)

true          

b)

false

c)

Compilation fails

d)

An exception is thrown at runtime

4.
a)

falsefalse      

b)

truefalse       

c)

falsetrue       

d)

truetrue

5.
a)

11  

b)

10

c)

Nothing

d)

     Infinite loop (Endless loop)     

6.
a)

Compile Error at line 1    

b)

Compile Error at line 2

c)

Compile Error at line 3

d)

None of the above

7.
a)

a = 6 b = 1

b)

a = 7 b = 2

c)

a = 6 b = 0            

d)

Compilation fails.       

8.
a)

5 - 14     

b)

5 - 13     

c)

6 - 14

d)

6 – 13

9.
a)

l      

b)

lo    

c)

llo  

d)

Compilation fails                 

10.
a)

Compilation fails at line 1 and line 2

b)

Compilation fails at line 3       

c)

Compilation fails at line 4 and line 5    

d)

0 5 0 7           

11.
a)

[Java, JavaFx, WebGL][WebGL, JavaFx, Java]     

b)

[WebGL, JavaFx, Java][Java, JavaFx, WebGL]

c)

[Java, JavaFx, WebGL][Java, JavaFx, WebGL]     

d)

[WebGL, JavaFx, Java][WebGL, JavaFx, Java]

12.
a)

Compile time error

b)

Super

c)

Subclass

d)

Runtime error

13.
a)

RuntimeException

b)

ClassCastException

c)

NullPointerException

d)

D. IOException

14.
a)

An abstract method can not override an another abstract method.

b)

  A specific method can not override an another abstract method.

c)

An abstract method can not be declared with the keyword throws

d)

No sentences above are true

15.
a)

Prints: C.printB1 C.printB2

b)

Prints: C.printB1 B.printB2

c)

Prints: B.printB1 C.printB2

d)

  Prints: B.printB1 B.printB2

16.
a)

Yes

b)

No

17.
a)

abstract

b)

final

c)

private     

d)

  static

18.
a)

The “extend” keyword is used to extend a class in java.

b)

You can extend multiple classes in java.

c)

Private members of the superclass are accessible to the subclass.

d)

We can’t extend Final classes in java.

19.
a)

A try statement must have at least one corresponding catch block.

b)

Multiple catch statements can catch the same class of exception more than once.

c)

An Error that might be thrown in a method must be declared as thrown by that method, or be handled within that method.

d)

Except in case of VM shutdown, if a try block starts to execute, a corresponding finally block will always start to execute.        

20.
a)

CallableStatement Interface

b)

PreparedStatement Interface

c)

CallableStatement Class

d)

None of the above

21.
a)

Connection

b)

Statement

c)

ResultSet

d)

None of the above

22.
a)

line 1

b)

line 2     

c)

line 1 and line 2 

d)

   None of above

23.
a)

nothing 

b)

Runtime Exception            

c)

Compile fails       

d)

NullPointerException

24.
a)

Compile fails.      

b)

Compile successfully but if method a or method b add abstract declaration then compile fails.      

c)

Compile successfully but if remove protected declaration at method b then compile fails.       

d)

None of the above     

25.
a)

Compile fails.      

b)

Runtime Exception.  

c)

Nothing.

d)

   None of the above.