JAVA Exceptions try{ File f = new File("a.txt");}catch(Exception e){}catch(IOException io){}Is this code create new file name a.txt ? true None of these Compilation Error false true None of these Compilation Error false ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions In which of the following package Exception class exist? java.util java.io java.file java.lang java.net java.util java.io java.file java.lang java.net ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions Predict the output:public class Test{ public static void main(String args[]){ try{ String arr[] = new String[10]; arr = null; arr[0] = "one"; System.out.print(arr[0]); }catch(Exception ex){ System.out.print("exception"); }catch(NullPointerException nex){ System.out.print("null pointer exception"); } }} "one" is printed. Compilation fails saying NullPointerException has already been caught. "exception" is printed. "null pointer exception" is printed. None of these "one" is printed. Compilation fails saying NullPointerException has already been caught. "exception" is printed. "null pointer exception" is printed. None of these ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions Exception generated in try block is caught in ........... block. catch throws throw finally catch throws throw finally ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions Determine output of the following program code?public class Test{ public static void main(String args[]){ int i; try{ i = calculate(); System.out.println(i); }catch(Exception e){ System.out.println("Error occured"); } } static int calculate(){ return (7/2); }} Compilation Error Error occured 3 3.5 None of these Compilation Error Error occured 3 3.5 None of these ANSWER DOWNLOAD EXAMIANS APP
JAVA Exceptions public class Test{ public static void main(String args[]){ try{ int a = Integer.parseInt("four"); } }}Which exception could be handled by the catch block for above? NumberFormatException IllegalStateException None of these ArrayIndexOutOfBoundsException ClassCastException NumberFormatException IllegalStateException None of these ArrayIndexOutOfBoundsException ClassCastException ANSWER DOWNLOAD EXAMIANS APP