What is the output of the following code? public class Test…
What is the output of the following code? public class Test { public static void main(String[] args) { try { int[] arr = null; int b = arr.length; } catch (ArrayIndexOutOfBoundsException e) { System.out.print(“oops…”); } catch (NullPointerException e) { System.out.print(“ok…”); } finally { System.out.println(“done”); } }} [BLANK-1]
Read DetailsWhat is the output of the following program?public class Tes…
What is the output of the following program?public class Test { public static void main(String[] args) { String s = “edcba”; System.out.println(foo(s)); } public static String foo(String s) { if (s==null || s.length()==1) return s; else { return s.charAt(s.length()-1) + foo(s.substring(0,s.length()-1)); } }} [BLANK-1]
Read Details