Home
MCQs
Java MCQs
Data Types
Java MCQs

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

Answer: B

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

Answer: A

13. What is the default size of int ?

A. 1 byte

B. 2 bytes

C. 4 bytes

D. 8 bytes

Answer: C

14. What is the default value of long ?

A. 0.00

B. 0L

C. 0B

D. 0I

Answer: B

15. What is the default size of long ?

A. 1 byte

B. 2 bytes

C. 4 bytes

D. 8 bytes

Answer: D

16. What is the default value of float ?

A. 0L

B. 0.0f

C. 0f

D. 0.0d

Answer: B

17. What is the default size of float ?

A. 1 byte

B. 2 bytes

C. 4 bytes

D. 8 bytes

Answer: C

18. What is the default value of double ?

A. 0L

B. 0f

C. 0d

D. 0.0d

Answer: D

19. What is the default size of double ?

A. 1 byte

B. 2 bytes

C. 4 bytes

D. 8 bytes

Answer: D

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

Answer: B