Java MCQ on Objects and Classes | Mock OCJP


Java multiple choice questions on Objects and Classes. Free online self-assessment test on Java programming language to evaluate the understanding of Java basics for beginners. First test from the Java online test series. These mock test series on Java programming language consisting of a wide range of multiple-choice questions are designed to evaluate the self-performance of Java skills. Very useful in interviews and OCJP certification exam preparation.



Java Online Mock OCJP Test Series: 1

Topic- Objects and Classes in Java

The test consists of 14 questions on Java.

No negative marking for this test.

No Time limit

The pass percentage is 70%

The correct answer with a description will be displayed after the answer has been marked.

Submit the test to calculate your score once you are done with all the questions.

Complexity Level- Easy







Q1: Select the correct output for the below code snippet:

public class abc {
int i;
public int a(int x){
i=x+1;
System.out.println("Value of i="+i);
return i;
}
}

public class xyz {
abc obj1,obj2;

public xyz(){
obj1=new abc();
obj2=obj1;
obj2.a(3);
}
public static void main(String[] args) {
xyz x=new xyz();
}
}













Q2: A reference variable in Java is _________

Select the correct answer:













Q3: An instance variable in Java is _______














Q4: A static variable in Java is _______














Q5: Select all that applies for a nested static member class:





















Q6: An anonymous class in Java is _____?

Select the correct answer:













Q7: Garbage collection in Java is _____













Q8: Object Finalization in Java is __________














Q9: A final class in java is _______

Select the correct answer:














Q 10: An abstract class cannot be instantiated:

Select True or False:











Q 11: System.gc() is a method used to _______











Q 12: Select all that applies for a nested Non-static member class:






















Q 13: An object in java can be referenced by multiple reference variables:

Select True or False












Q 14: A local class in java is ________





















Quantitative aptitude - practice tests


A series of aptitude practice tests comprising multiple-choice questions (MCQ) on varied aptitude topics that evaluate the quantitative ability.