try{if((newObject))(.equals((newObject()))){System.out.println(equal”);}else{System.out.println(notequal”);}}catch(Exceptione){System.out.println(exception”);}Whatistheresult?() A.equal B.notequal C.exception D.Compilationfails.
try{if((newObject))(.equals((newObject()))){System.out.println(equal”);}else{System.out.println(notequal”);}}catch(Exceptione){System.out.println(exception”);}Whatistheresult?() A.equal B.notequal C.exception D.Compilationfails.
publicstaticvoidparse(Stringstr){try{floatf=Float.parseFloat(str);}catch(NumberFormatExceptionnfe){f=0;}finally{System.out.println(f);}}publicstaticvoidmain(String[]args){parse(”invalid”);}Whatistheresult?() A.0.0 B.Compilationfails. C.AParseExceptionisthrownbytheparsemethodatruntime. D.ANumberFormatExceptionisthrownbytheparsemethodatruntime.
publicstaticvoidparse(Stringstr){try{floatf=Float.parseFloat(str);}catch(NumberFormatExceptionnfe){f=0;}finally{System.out.println(f);}}publicstaticvoidmain(String[]args){parse(”invalid”);}Whatistheresult?() A.0.0 B.Compilationfails. C.AParseExceptionisthrownbytheparsemethodatruntime. D.ANumberFormatExceptionisthrownbytheparsemethodatruntime.
1