翁舟洋2012-6-8Question1Given:{(){(“A“)}}{()throwsRuntimeException{();(true)thrownewRuntimeException();(“B”)}}(String[]args){{((A)newB()).process();}(Exceptione){(“Exception“)}21.}Whatistheresult?:B考点:异常的抛出说明:任何一个方法,将默认在其签名上写上throwsRuntimeException,此处不认为子类重写方法抛出了比父类对应方法更多的异常。Question2Given:{()throwsException{thrownewException();}13.}{(){(“B”)}16.}(String[]args){=newB();();20.}Whatistheresult?:A考点:继承,重写,异常的抛出,说明:父类A变量指向子类B的对象,调用B中的process()方法Question3Given:{()throwsException{thrownewException();}13.}{(){(“B”);16.}(String[]args){().process();19.}Whatistheresult?:考点:说明:Question4Given:{=();=(“GETINFOFROMCUSTOMER”)=();();89.}catch(ResourceExceptionre){(());91.};WhichistrueifaResourceExceptionisthrownonline86?:C考点:try.....catch....说明:异常被捕获处理后,异常try…catch..结构后的语句将继续运行,程序不会中止,但是try块中发生异常的语句之后的语句将不再运行。{(){3
JAVA基础面试题 来自淘豆网m.daumloan.com转载请标明出处.