Java Data Types - MCQ Practice Worksheet
1. Which of the following is a primitive data type?
a) String
b) Integer
c) char
d) Scanner
2. What is the size of an int in Java?
a) 4 bytes
b) 2 bytes
c) 1 byte
d) 8 bytes
3. Which data type is used to store true/false values?
a) bit
b) boolean
c) char
d) int
4. What is the default value of a byte?
a) 0
b) null
c) 0.0
d) false
5. Which of these can hold a 64-bit integer?
a) int
b) long
c) short
Page 1
Java Data Types - MCQ Practice Worksheet
d) byte
6. Which of these data types has the smallest size?
a) byte
b) int
c) float
d) long
7. Which data type is used for single-precision floating point?
a) double
b) float
c) int
d) long
8. Which data type is not primitive?
a) int
b) char
c) String
d) boolean
9. What is the range of a byte in Java?
a) -128 to 127
b) -256 to 255
c) -32,768 to 32,767
d) 0 to 255
10. Which keyword is used to define a constant variable?
a) static
b) final
Page 2
Java Data Types - MCQ Practice Worksheet
c) const
d) constant
11. What does the char data type store?
a) Numbers
b) True/False
c) Single characters
d) Strings
12. How many bits are used to store a boolean?
a) 1
b) 8
c) JVM dependent
d) 16
13. What is the wrapper class for int?
a) Integer
b) Int
c) Number
d) Object
14. Which type can store more precise values?
a) float
b) double
c) int
d) long
15. Which of these types is used for Unicode characters?
a) int
Page 3
Java Data Types - MCQ Practice Worksheet
b) char
c) byte
d) short
16. What is the default value of boolean in Java?
a) true
b) 0
c) false
d) null
17. Which of the following is the largest in memory size?
a) short
b) int
c) long
d) byte
18. Which type has the highest precision for decimals?
a) float
b) double
c) long
d) int
19. Which of the following types is signed?
a) int
b) char
c) String
d) boolean
20. Which primitive type can store the largest integer value?
Page 4
Java Data Types - MCQ Practice Worksheet
a) byte
b) short
c) int
d) long
21. Which type is most appropriate to store age?
a) byte
b) int
c) float
d) long
22. Which primitive type is used to store decimal numbers?
a) int
b) char
c) double
d) long
23. Which data type cannot be implicitly converted to int?
a) byte
b) char
c) short
d) float
24. Which wrapper class corresponds to double?
a) Double
b) Dbl
c) Floating
d) Float
Page 5
Java Data Types - MCQ Practice Worksheet
25. What is the size of a short in Java?
a) 1 byte
b) 2 bytes
c) 4 bytes
d) 8 bytes
Page 6