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.

1. What are the types of data types in Java?

A. Primitive Data types

B. Non-primitive Data Types

C. Both of above

Answer: C

2. Which is not a primitive data type?

A. Boolean

B. Character

C. Arrays

D. Integer

Answer: C

3. Which are the non-primitive data types ?

A. Arrays

B. Classes

C. Interfaces

D. All of Above

Answer: D

4. What is the default value of boolean?

A. true

B. false

C. '1'

D. '0'

Answer: B

5. What is the default size of boolean datatype?

A. 2 bytes

B. 4 bytes

C. 1 bit

D. 2 bits

Answer: C

6. What is the default value of char ?

A. ''

B. '0000'

C. '0'

D. '\u0000'

Answer: D

7. What is the default size of char ?

A. 1 byte

B. 2 bytes

C. 4 bytes

D. 8 bytes

Answer: B

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

Answer: A

9. What is the default size of byte ?

A. 1 bit

B. 1 byte

C. 2 bytes

D. 4 bytes

Answer: B

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

Answer: A