Multiple Choice Questions
![]() Share with a Friend |
public class Test{
public static void main(String[] a){
short x = 10;
x = x*5;
System.out.print(x);
}
}
A). 50
public class Test{
public static void main(String args[]){
float f = (1 / 4) * 10;
int i = Math.round(f);
System.out.println(i);
}
}
A). 2
public class Test{
public static void main(String[] args){
byte b=127;
b++;
b++;
System.out.println(b);
}
}
A). 2
public class A{
static{
System.out.println("static");
}
{
System.out.println("block");
}
public A(){
System.out.println("A");
}
public static void main(String[] args){
A a = new A();
}
}
A). A block static
int x = 0, y = 0 , z = 0 ;
x = (++x + y-- ) * z++;
What will be the value of "x" after execution ?