Which of the following is not considered as data type in Java?
String
int
boolean
double
View Answer
Correct Answer: A — String
Explanation:
No explanation is available for this question yet.
9 practice sets · Page 1 of 1
Which of the following is not considered as data type in Java?
String
int
boolean
double
Correct Answer: A — String
Explanation:
No explanation is available for this question yet.
What is the range of 'byte' data type?
-127 to 127
-128 to 128
-127 to 128
-128 to 127
Correct Answer: D — -128 to 127
Explanation:
No explanation is available for this question yet.
Which of the following is default value of 'double' data type?
0
0.0d
null
False
Correct Answer: B — 0.0d
Explanation:
Default value is assigned to a variable by memory when it is declared but not initialized.
Which of the following is default value of 'int' data type?
0
null
True
False
Correct Answer: A — 0
Explanation:
Default value is assigned to a variable by memory when it is declared but not initialized.
What is the range of 'short' data type?
-(2^15+1) to (2^15-1)
-2^15 to 2^15
-(2^15-1) to (2^15+1)
-(2^15-1) to 2^15
Correct Answer: D — -(2^15-1) to 2^15
Explanation:
No explanation is available for this question yet.
What is the maximum value of 'byte' data type?
2^7
2^7+1
2^7-1
None of the mentioned
Correct Answer: C — 2^7-1
Explanation:
No explanation is available for this question yet.
What is the minimum value of 'short' data type?
-32,768
-127
-2,147,483,648
-32,767
Correct Answer: A — -32,768
Explanation:
No explanation is available for this question yet.
What is the size(in bytes) of 'byte' primitive data type?
4
1
2
8
Correct Answer: B — 1
Explanation:
'byte' is a signed 8-bit(1byte) data type defined by Java.
Which of the following data type is used to fetch stream of data from network or file?
char
int
byte
double
Correct Answer: C — byte
Explanation:
When input is taken from keyboard or file it is taken in the form of bits by the machine. Byte is a collection of bits that makes user read a character at the output at a time. Usage of byte also saves memory.