Java MCQ Questions and Answers Quiz

31. Which of the following is used to see the details of the compilation

  1. javac -detail TestExample.java
  2. javac -verbose TestExample.java
  3. None of these
  4. javac -debug TestExample.java

32. Which of the following is not a keyword in Java.

  1. boolean
  2. assert
  3. finalize
  4. abstract

33. Which of the following is not a keyword in Java.

  1. strictfp
  2. instanceof
  3. emun
  4. transient

34. We can write comment like this jn Java Programming: /* /* comment 1 */ comment 2 */

  1. true
  2. false

35. What is Literal in Java Programming?

  1. Source code representation of a fixed value
  2. special type of class
  3. special type of data type
  4. none of these

36. It is possible to assign a literal to a variableof a primitive type.

  1. False statement
  2. True statement

37. boolean result = true; Which type of literal is assigned to the variable result?

  1. boolean
  2. char
  3. string
  4. bool

38. Which type of literal is written in pair of single quote?

  1. float
  2. boolean
  3. integer
  4. character

39. An integer literal is of type long if and only if it has suffix - ______ in Java programming.

  1. L
  2. D
  3. O
  4. F

40. ____ literal is used to create values of the integral types byte, short, int and long.

  1. Double
  2. Integer
  3. Byte
  4. Long
Tags

MCQ Multiple Choice Questions and Answers on Java

Java Question and Answer