81. If we try to add Enum constants to a TreeSet, what sorting order will it use?
82. What is the base of BigDecimal data type?
83. What will be the output of the following Java statement?
class output {
public static void main(String args[])
{
double a, b,c;
a = 3.0/0;
b = 0/4.0;
c=0/0.0;
System.out.println(a);
System.out.println(b);
System.out.println(c);
}
}
class output {
public static void main(String args[])
{
double a, b,c;
a = 3.0/0;
b = 0/4.0;
c=0/0.0;
System.out.println(a);
System.out.println(b);
System.out.println(c);
}
}
84. What will be the output of the following Java code?
class booloperators {
public static void main(String args[])
{
boolean var1 = true;
boolean var2 = false;
System.out.println((var1 & var2));
}
}
class booloperators {
public static void main(String args[])
{
boolean var1 = true;
boolean var2 = false;
System.out.println((var1 & var2));
}
}
85. What will be the output of the following Java code?
class conversion
{
public static void main(String args[])
{
double a = 295.04;
int b = 300;
byte c = (byte) a;
byte d = (byte) b;
System.out.println(c + " " + d);
}
}
class conversion
{
public static void main(String args[])
{
double a = 295.04;
int b = 300;
byte c = (byte) a;
byte d = (byte) b;
System.out.println(c + " " + d);
}
}
86. An expression involving byte, int, and literal numbers is promoted to which of these?
87. Literal can be of which of these data types?
88. What is the numerical range of a char data type in Java?
89. How is Date stored in database?
90. Which method returns the elements of Enum class?
Read More Section(Data Types and Variables)
Each Section contains maximum 100 MCQs question on Data Types and Variables. To get more questions visit other sections.