Java Programming - Data Types Questions and Answers

Java Programming : Java Data Types

Java Data Types Multiple Choice Questions and Answers for Interviews. Java Data Types Means all variables must first be declared before they can be used.

1. which of the following is the smallest integer data type ?
[A] int
[B] long
[C] byte
[D] short

Answer: C. byte

2. which of the following is not a primitive data type.
[A] byte
[B] short
[C] enum
[D] int

Answer: C. enum

3. which value can not store character data type.
[A] Digit
[B] Special character
[C] String
[D] Letter

Answer: D. Letter

4. which of the following data types comes under floating data types ?
[A] byte
[B] int
[C] float
[D] long

Answer: C. float

5. Range of byte data type is ?
[A] -128 to 255
[B] -128 to 256
[C] -128 to 127
[D] -127 to 128

Answer: C. -128 to 127

6. In order to fetch stream of data from network or file, following data type used ?
[A] double
[B] char
[C] int
[D] byte

Answer: D. byte

7. what is size of integer in java programming.
[A] 4 bytes
[B] 5 bytes
[C] 2 bytes
[D] 8 bytes

Answer: A. 4 bytes

8. How many byte will byte data type take in java ?
[A] 1
[B] 2
[C] 3
[D] 4

Answer: A. 1

9. which data type can store  64 bit value ?
[A] double
[B] int
[C] long
[D] float

Answer: A. double

10. Short data type has a minimum value of……….. ?
[A] -32767
[B] -2,147,483,648
[C] -32768
[D] -127

Answer: C. -32768

Are these questions helpful for you?

Comments: (Your feedback is valuable to us)

yogesh rawat 2 years ago Reply

Great work

Debjit Rowdian Banerjee 2 years ago Reply


alpesh sakhanpara 2 years ago Reply