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