
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.
1. What are the types of data types in Java?
A. Primitive Data types
B. Non-primitive Data Types
C. Both of above
View Answer
2. Which is not a primitive data type?
A. Boolean
B. Character
C. Arrays
D. Integer
View Answer
3. Which are the non-primitive data types ?
A. Arrays
B. Classes
C. Interfaces
D. All of Above
View Answer
4. What is the default value of boolean?
A. true
B. false
C. '1'
D. '0'
View Answer
5. What is the default size of boolean datatype?
A. 2 bytes
B. 4 bytes
C. 1 bit
D. 2 bits
View Answer
6. What is the default value of char ?
A. ''
B. '0000'
C. '0'
D. '\u0000'
View Answer
7. What is the default size of char ?
A. 1 byte
B. 2 bytes
C. 4 bytes
D. 8 bytes
View Answer
8. What is the default value of byte ?
A. 0 default value
B. 0b default value
C. 0.0 default value
D. 0.0f default value
View Answer
9. What is the default size of byte ?
A. 1 bit
B. 1 byte
C. 2 bytes
D. 4 bytes
View Answer
10. What is the default value of short ?
A. 0 default value
B. 0s default value
C. 0.0 default value
D. 0.0f default value
View Answer