Tutorial Study Image

Java Online Quiz

Following quiz provides Multiple Choice Questions (MCQs) related to Java . You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.


Q 1 - public static void main(String args[]) { int x; x = 1; { int y = 2; } System.out.println(x "+" y); } What will be the output of the code snippet?

Show Answer
 Answer is : Option D

Q 2 - When a new object is initialized it is stored in which part of the heap?

Show Answer
 Answer is : Option B

Q 3 - Java is architecture-neutral, which is same as ________

Show Answer
 Answer is : Option C

Q 4 - Which of the following is not a peculiarity of java?

Show Answer
 Answer is : Option C

Q 5 - Local variables of a method are stored in?

Show Answer
 Answer is : Option A

Q 6 - A function that returns no value returns _______ ?

Show Answer
 Answer is : Option B

Q 7 - A composition relationship is also called?

Show Answer
 Answer is : Option B

Q 8 - System.out.println("\\");. Outputs?

Show Answer
 Answer is : Option B

Q 9 - ____________ checks for equality between controlling expression and constant cases ?

Show Answer
 Answer is : Option D

Q 10 - Which of the following methods is used for extracting more than one character from a string?

Show Answer
 Answer is : Option C