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?



  • Array


  • Boolean


  • Char


  • None of these

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



  • 7


  • 8


  • 6


  • None of these

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



  • 8 bit


  • 16 bit


  • None of these

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



  • 0


  • 0.0


  • 0.0d


  • None of these

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



  • 0


  • 0.0f


  • 0.0d


  • None of these

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



  • 4 byte


  • 2 byte


  • 8 byte


  • None of these

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



  • 5


  • 5.0


  • 5.0d


  • None of these

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



  • 4 byte


  • 8 byte


  • 16 byte


  • None of these

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



  • int


  • char


  • No return type


  • None of these

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



  • -128 to 127


  • 128 to 127


  • -32768 to 32767


  • None of these

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



  • 8 byte


  • 4 byte


  • 2 byte


  • None of these

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



  • 0


  • 0.0


  • 0.0L


  • None of these

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



  • TRUE


  • FALSE


  • null


  • None of these

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



  • double, long, int, short, byte


  • byte, long, int, short, double


  • double, byte, int, short, long


  • None of these

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



  • double, long, int, short, byte


  • byte, long, int, short, double


  • byte, short, int, long, double


  • None of these

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



  • short


  • int


  • long double


  • None of these

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



  • 1 byte


  • 2 bytes


  • 4 bytes


  • None of these

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



  • 0 to 65535


  • 0 to 65536


  • 0 to 125


  • None of these

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



  • Data container


  • Variable store


  • Data


  • None of these

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



  • Global Variable


  • Local Variable


  • Instance variable


  • None of these

Scroll to Top