Java MCQs - Data Types
Data type identify the size and type of the value that can be stored in variable. The Java Language is rich by perspective of data types which allow you to go with different types and different sizes of the variable. Here is a list of all possible Data type MCQs with interview questions and answers.
11. What is the default size of short ?
A. 1 byte
B. 2 bytes
C. 4 bytes
D. 8 bytes
View Answer
12. What is the default value of int ?
A. 0 default value
B. 0i default value
C. 0l default value
D. 0.0f default value
View Answer
13. What is the default size of int ?
A. 1 byte
B. 2 bytes
C. 4 bytes
D. 8 bytes
View Answer
14. What is the default value of long ?
A. 0.00
B. 0L
C. 0B
D. 0I
View Answer
15. What is the default size of long ?
A. 1 byte
B. 2 bytes
C. 4 bytes
D. 8 bytes
View Answer
16. What is the default value of float ?
A. 0L
B. 0.0f
C. 0f
D. 0.0d
View Answer
17. What is the default size of float ?
A. 1 byte
B. 2 bytes
C. 4 bytes
D. 8 bytes
View Answer
18. What is the default value of double ?
A. 0L
B. 0f
C. 0d
D. 0.0d
View Answer
19. What is the default size of double ?
A. 1 byte
B. 2 bytes
C. 4 bytes
D. 8 bytes
View Answer
20. What is the output of this program?
A. 0 default value
B. Compile time error - Local variable may not have been initialized
C. Run time error - Local variable may not have been initialized
D. None of Above
View Answer
