An expression involving byte, int, and literal numbers is promoted to which of these?
int
long
byte
float
SHOW ANSWERWhich data type value is returned by all transcendental math functions?
int
float
double
long
SHOW ANSWERWhat is the output of this program?
class average {
public static void main(String args[])
{
double num[] = {5.5, 10.1, 11, 12.8, 56.9, 2.5};
double result;
result = 0;
for (int i = 0; i < 6; ++i)
result = result + num[i];
System.out.print(result/6);
}
}
16.34
16.566666644
16.46666666666667
16.46666666666666
SHOW ANSWERWhat will be the output of these 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);
}
}
Infinity
0.0
NaN
all of the mentioned
SHOW ANSWERWhat is the output of this program?
class increment {
public static void main(String args[])
{
int g = 3;
System.out.print(++g * 8);
}
}
25
24
32
33
SHOW ANSWERWhat is the output of this program?
class area {
public static void main(String args[])
{
double r, pi, a;
r = 9.8;
pi = 3.14;
a = pi * r * r;
System.out.println(a);
}
}
301.5656
301
301.56
301.56560000
SHOW ANSWERWhich of these coding types is used for data type characters in Java?
ASCII
ISO-LATIN-1
UNICODE
None of the mentioned
SHOW ANSWERWhich of these values can a boolean variable contain?
True & False
0 & 1
Any integer value
true
SHOW ANSWERWhich one is a valid declaration of a boolean?
boolean b1 = 1;
boolean b2 = ‘false’;
boolean b3 = false;
boolean b4 = ‘true’
SHOW ANSWERWhat is the output of this program?
class array_output {
public static void main(String args[])
{
char array_variable [] = new char[10];
for (int i = 0; i < 10; ++i) {
array_variable[i] = 'i';
System.out.print(array_variable[i] + "" );
i++;
}
}
}
i i i i i
0 1 2 3 4
i j k l m
None of the mentioned
SHOW ANSWERWhat is the output of this program?
class mainclass {
public static void main(String args[])
{
char a = 'A';
a++;
System.out.print((int)a);
}
}
66
67
65
64
SHOW ANSWERWhat is the output of this program?
class mainclass {
public static void main(String args[])
{
boolean var1 = true;
boolean var2 = false;
if (var1)
System.out.println(var1);
else
System.out.println(var2);
}
}
0
1
true
false
SHOW ANSWERWhat is the output of this program?
class booloperators {
public static void main(String args[])
{
boolean var1 = true;
boolean var2 = false;
System.out.println((var1 & var2));
}
}
0
1
true
false
SHOW ANSWER