Loading...
QUIZ

Certification Test

 
Que No. 1 ) What is the Java term for a function defined within a class?

A.) Procedure
B.) Function
C.) Method
D.) Block


Que No. 2 ) Which Java keyword is used to handle exceptions?

A.) try
B.) catch
C.) throw
D.) exception


Que No. 3 ) What is the purpose of the "super" keyword in Java?

A.) To refer to a superclass's method or constructor
B.) To access a supercomputer
C.) To indicate a superior class
D.) To declare a superclass


Que No. 4 ) Which collection framework interface represents an ordered collection of elements with no duplicates?

A.) Set
B.) List
C.) Map
D.) Queue


Que No. 5 ) Which operator is used to compare two objects for reference equality in Java?

A.) ==
B.) =
C.) .equals()
D.) .compareTo()


Que No. 6 ) Which of the following is true about Java's automatic memory management (garbage collection)?

A.) Developers must manually free memory
B.) Memory is never automatically released
C.) Unreferenced objects are automatically deallocated
D.) Garbage collection requires explicit calls


Que No. 7 ) What is the purpose of the "break" statement in Java?

A.) To exit a loop or switch statement prematurely
B.) To start a new loop iteration
C.) To skip the current loop iteration
D.) To divide a loop into multiple parts


Que No. 8 ) Which of the following is a valid declaration of a two-dimensional array in Java?

A.) int[][] myArray = new int[3][4];
B.) int[3][4] myArray = new int[][];
C.) int[3, 4] myArray = new int[][];
D.) int[3][4] myArray;


Que No. 9 ) What is the purpose of the "static" keyword in Java?

A.) To define a constant variable
B.) To create an instance of a class
C.) To indicate that a method or variable belongs to the class, not an instance
D.) To make a method thread-safe


Que No. 10 ) What is the output of the following code snippet? int x = 5; x += 3; System.out.println(x);

A.) 5
B.) 3
C.) 8
D.) 15