A. void methoda(); B. public double methoda(); C. public final double methoda(); D. static void methoda(double d1); E. protected void methoda(double d1);
public class X { public static void main(String [] args) { try { badMethod(); System.out.print(“A”); } catch (Exception ex) { System.out.print(“B”); } finally { System.out.print(“C”); } System.out.print(“D”); } public static void badMethod() {} } What is the result?()
A. AC B. BD C. ACD D. ABCD E. Compilation fails.
int i = 1,j = -1; switch (i) { case 0, 1:j = 1; case 2: j = 2; default; j = 0; } System.out.println(“j=”+j); What is the result?()
A. j = -1 B. j = 0 C. j = 1 D. j = 2 E. Compilation fails.