Submitted by c-admin on Wed, 06/05/2019 - 06:43
The following program will print java.lang.ArithmeticException: / by zero
class Test{
public static void main(String[] args){
int d = 0;
try{
int i = 1 / (d* doIt());
} catch (Exception e){
System.out.println(e);
}
}
public static int doIt() throws Exception{
throw new Exception("Forget It");
}
}
Select 1 option
A. True
B. False
Submitted by c-admin on Tue, 06/04/2019 - 23:27
A method with no access modifier can be overridden by a method marked protected.
Select 1 option
A. True
B. False
Submitted by c-admin on Tue, 06/04/2019 - 22:47
Using a continue in a while loop causes the loop to break the current iteration and start the next iteration of the loop.
Select 1 option
A. True
B. False
Submitted by c-admin on Tue, 06/04/2019 - 00:48
The following is a valid member variable declaration:
private static final transient int i = 20;
Select 1 option
A. True
B. False
Submitted by c-admin on Fri, 05/31/2019 - 10:21
The following class will not throw a NullPointerException when compiled and run.
class Test{
public static void main(String[] args) throws Exception{
int[] a = null;
int i = a [ m1() ];
}
public static int m1() throws Exception{
throw new Exception("Some Exception");
}
}
Select 1 option
A. True
B. False
Pages