Online GK Series

This site is dedicated to the aspirants of competitive exams SSC, UPSC, Railways, Postal Assistants, Bank, GATE and NET

Core Java Multiple Choice Questions and Answers for Interview | Quiz MCQs

1 The new operator
A returns a pointer to a variable
B creates a variable called new
C obtains memory for a new variable
D tells how much memory is available

Answer: Option [C]
2 Which of the following statement is correct?
A For positive numbers, result of operators >> and >>> are same
B Java provides two operators to do left shift <<< and <<
C >> is the zero fill right shift operator
D >>> is the signed right shift operator

Answer: Option [A]
3 Java language has support for which of the following types of comment ?
A block, line and javadoc
B javadoc, literal and string
C javadoc, char and string
D single, multiple and quote

Answer: Option [A]

Java supports three types of comments.

(i)Single line i.e. line e.g. //comment

(ii)Multi line i.e. block e.g. /*comment*/

(iii)Javadoc comments e.g. /**comment*/

4 Command to execute a compiled java program is :
A javac
B java
C run
D execute

Answer: Option [B]
5 The java compiler
A creates executable
B translates java source code to byte code
C creates classes
D produces java Interpreter

Answer: Option [B]

Computer Science Books