Questions List
Browse all explanatory questions of this chapter.
1
Which of the following will compile correctly?
-
boolean b=-1;
-
boolean b2=false;
-
int i=019;
-
char c=99;
boolean b=-1;
boolean b2=false;
int i=019;
char c=99;
2
Which of the following will compile correctly?
-
short myshort=99S;
-
String name='Excellent tutorial Mr Green';
-
char c=17c;
-
int z=015;
short myshort=99S;
String name='Excellent tutorial Mr Green';
char c=17c;
int z=015;
3
Which of the following will compile correctly?
-
float f=10f;
-
float f=10.1;
-
float f=10.1f;
-
byte b=10b;
float f=10f;
float f=10.1;
float f=10.1f;
byte b=10b;
4
Are "true" and true the same? Similarly, are "false" and false the same?
5
Is a string of one character the same as a character literal?
6
Which values can be assigned to a boolean variable?
7
What are Java’s integer types?
8
Why does Java use Unicode?
9
Why are data types important?
10
Can every class be referred to as a user-defined datatype?
11
Can you refer to a class as a composite type / user-defined type?
12
What is a composite datatype? What is a user-defined datatype?
13
What is a datatype?
14
What is difference between float and double in Java?
15
What is the default value of byte datatype in Java?
16
What is the numerical range of a char data type in Java?
17
Can a double value be cast to a byte?
18
What is Downcasting?
19
What is the range of the short type?
20
What is type casting?
21
Why do we need wrapper classes?
22
List primitive Java types?
23
What are Wrapper classes?
24
Why is String class considered immutable?
25