Java MCQs with answers Page - 6

Here, you will find a collection of MCQ questions on Java. Go through these questions to enhance your preparation for upcoming examinations and interviews.

To check the correct answer, simply click the View Answer button provided for each question.

Have your own questions to contribute? Click the button below to share your MCQs with others!

+ Add Question

A

Admin • 831.35K Points
Coach

Q. Java source files are compiled and converted to

  • (A) Object code
  • (B) machine code
  • (C) Bytecode
  • (D) executable file

A

Admin • 831.35K Points
Coach

Q. JVM is ___________for bytecode.

  • (A) a compiler
  • (B) an interpreter
  • (C) assembler
  • (D) none of the above

A

Admin • 831.35K Points
Coach

Q. What is the size of int data type in java?

  • (A) 1 bytes
  • (B) 2 bytes
  • (C) 4 bytes
  • (D) 8 bytes

A

Admin • 831.35K Points
Coach

Q. Which is a valid float literal?

  • (A) 1.23
  • (B) 2
  • (C) 1.23d
  • (D) 1.23f

A

Admin • 831.35K Points
Coach

Q. What is the numerical range of a char in Java?

  • (A) -128 to 127
  • (B) 0 to 256
  • (C) 0 to 32767
  • (D) 0 to 65535

A

Admin • 831.35K Points
Coach

Q. Which of these coding types is used for data type char in Java?

  • (A) ASCII
  • (B) ISO-LATIN-1
  • (C) UNICODE
  • (D) None of the mentioned

A

Admin • 831.35K Points
Coach

Q. Which of these values can a boolean variable contain?

  • (A) True & False
  • (B) 0 & 1
  • (C) Any integer value.
  • (D) Both a & b

A

Admin • 831.35K Points
Coach

Q. Which one of the following is a valid identifier in java?

  • (A) x1
  • (B) 1x
  • (C) $x
  • (D) x 1

A

Admin • 831.35K Points
Coach

Q. Which operator is used to implement unsigned right shift of an integer?

  • (A) <<
  • (B) >>
  • (C) <<<
  • (D) >>>

A

Admin • 831.35K Points
Coach

Q. Which one of the following is a jump statement in java?

  • (A) goto
  • (B) jump
  • (C) break
  • (D) if