1. public class ForBar{
public static void main(String[] args){
int i=0,j=5;
tp:for(;;i++)
{for(;;--j)
if(i>j) break tp;
}
System.out.println("i="+i+";
j="+j);
}
}
a) the program runs and prints "i=1, j=-1"
b) the program runs and prints "i=1, j=4"
c) the program runs and prints "i=0, j=-1"
d) an Error line 4 causes compilation to fail
Given:
abstract class AbstractIt{
abstract float getFloat();
}
public class abstractTest extends AbstractIt{
private float f1= 1.0f;
private float getFloat(){
return f1;
}
}
What is the result?
a). Compilation is successful
b). An Error on line 6 cause a Runtime failture
c). An Error on line 6 cause compilation to fail
d). An Error on line 2 cause compilation to fail
32. What is the value decimal value of j at line 5?
public class Test{
public static void main(String sss[]){
int i=0xFFFFFFF1;
int j=-i;
}
}
a).0 b).1 c).14 d).-15