Java Data Types MCQs | Java MCQ

In this page provide you software multiple choice question which help to many exam like Semester exam, Gate Exam, Railway , ISRO etc.

Java Data Types MCQ SET-1

Q.1 Which of the following is NOT a primitive data type in Java?

  • A) Array
  • B) Boolean
  • C) Char
  • D) None of these

Q.2 How many primitive data types are defined in Java?

  • A) 7
  • B) 8
  • C) 6
  • D) None of these

Q.3 What is the size of the 'byte' data type in Java?

  • A) 8 bit
  • B) 4 bit
  • D) None of these

Q.4 What is the default value of the 'byte' data type in Java?

  • B) 0.0
  • C) 0.0d
  • D) None of these

Q.5 What is the default value of the 'float' data type in Java?

  • B) 0.0f
  • C) 0.0d
  • D) None of these

Q.6 What is the size of the 'double' data type in Java?

  • A) 4 byte
  • B) 2 byte
  • C) 8 byte
  • D) None of these

Q.7 What is the output of this code snippet? int a=5; double d=a; System.out.println(d);

  • A) 5
  • B) 5.0
  • C) 5.0d
  • D) None of these

Q.8 What is the memory size of the 'int' data type in Java?

  • A) 4 byte
  • B) 8 byte
  • C) 16 byte
  • D) None of these

Q.9 What is the return type of a constructor in Java?

  • A) int
  • B) char
  • C) No return type
  • D) None of these

Q.10 What is the range of the 'byte' data type?

  • A) -128 to 127
  • B) 128 to 127
  • C) -32768 to 32767
  • D) None of these

Q.11 What is the memory size of the 'long' data type in Java?

  • A) 8 byte
  • B) 4 byte
  • C) 2 byte
  • D) None of these

Q.12 What is the default value of the 'long' data type in Java?

  • B) 0.0
  • C) 0.0L
  • D) None of these

Q.13 What is the default value of a variable with the 'boolean' data type?

  • A) TRUE
  • B) FALSE
  • C) null
  • D) None of these

Q.14 Which of the following represents a correct hierarchy for implicit (widening) conversion?

  • A) double, long, int, short, byte
  • B) byte, long, int, short, double
  • C) double, byte, int, short, long
  • D) None of these

Q.15 Which of the following represents the order typically used for explicit (narrowing) conversion?

  • A) double, long, int, short, byte
  • B) byte, long, int, short, double
  • C) byte, short, int, long, double
  • D) None of these

Q.16 Which of the following is NOT a valid data type in Java?

  • A) short
  • B) int
  • C) long double
  • D) None of these

Q.17 What is the size of a 'char' data type in Java?

  • A) 1 byte
  • B) 2 bytes
  • C) 4 bytes
  • D) None of these

Q.18 What is the range of a 'char' data type constant in Java?

  • A) 0 to 65535
  • B) 0 to 65536
  • C) 0 to 125
  • D) None of these

Q.19 What is the fundamental definition of a variable?

  • A) Data container
  • B) Variable store
  • C) Data
  • D) None of these

Q.20 A variable whose value varies from object to object is known as a(n)?

  • A) Global Variable
  • B) Local Variable
  • C) Instance variable
  • D) None of these

Scroll to Top