网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
下面的代码中方法unsafe()有异常发生,那么可以加在第一行的语句为( )。 { if(unsafe()) { //do something } else if(safe()) { //do the other) } Ⅰ:public void methodName() Ⅱ:public void methodName() throw IOException Ⅲ:public void methodName() throws IOException Ⅳ:public void methodName() throws Exception
A.Ⅲ、Ⅳ
B.Ⅱ、Ⅲ、Ⅳ
C.Ⅰ、Ⅲ
D.Ⅰ、Ⅳ
参考答案
更多 “ 下面的代码中方法unsafe()有异常发生,那么可以加在第一行的语句为( )。 { if(unsafe()) { //do something } else if(safe()) { //do the other) } Ⅰ:public void methodName() Ⅱ:public void methodName() throw IOException Ⅲ:public void methodName() throws IOException Ⅳ:public void methodName() throws ExceptionA.Ⅲ、ⅣB.Ⅱ、Ⅲ、ⅣC.Ⅰ、ⅢD.Ⅰ、Ⅳ ” 相关考题
考题
在J2EE中,对于简单属性的方法:publicColorgetColor(){…}和publicVoidsetColor(Colorc){…}假定color是类中的属性,在方法体内可以()
A.在getColor方法体内只能有一行代码:returncolor;在setColor方法体内只能有一行代码:this.color=c;B.在getColor方法体内只能有一行代码:returncolor;在setColor方法体内一定有该行代码:this.color=c;但还可以有其他的代码C.在getColor方法体内一定有该行代码:returncolor;但还可以有其他的代码,在setColor方法体内只能有该行代码:this.color=c;D.在getColor方法体内一定要有该行代码:returncolor;但还可以有其他的代码,在setColor方法体内一定有该行代码:this.color=c;但还可以有其他的代码
考题
在DO WHILE…ENDDO循环结构中,EXIT命令的作用是A)退出过程,返回程序开始处B)转移到DO WHILE语句行,开始下一个判断和循环C)终止循环,将控制转移到本循环结构ENDDO后面的第一条语句继续执行D)终止程序执行
考题
在DO WHILE…ENDDO循环结构中,LOOP命令的作用是( )。A.终止程序的运行B.退出循环,返回程序开始处继续执行C.转到DO WHILE语句行,开始下一次循环D.终止本次循环,将控制转到本循环结构ENDDO后面的第一条语句继续执行
考题
—________________ , but I still have the feeling that it's not safe enough. —I couldn't agree more. That's why I only do street shopping.
A Paying online is much unsafe than before ;B Paying online is less safer than before ;C Paying online is much safer than before
考题
下面的程序是用do-while语句计算10的阶乘。请在程序的每条横线处填写1个语句,使程序的功能完整。注意:请勿改动main()主方法和其他已有的语句内容;仅在横线处填入适当的语句。源程序文件代码清单如下:public class DoWhileLoop{public static void main(______){int n=10;long result=1;do{_____;}_____;System.out.println("10的阶乘为:"+result);}}
考题
下列关于捕获异常的描述中,错误的是______。A.在异常处理代码段中无法访问hy代码段中声明的变量B.子类异常可被父类异常捕获处理C.try-catch机制可以被用于流程控制D.在catch代码段中的return语句用于退出方法,而不是返回异常抛出点
考题
下面说法正确的是_________。
A.如果源代码中有package语句,则该语句必须放在代码的第一行(不考虑注释和空格)B.如果源代码中有import语句,则该语句必须放在在代码的第一行(不考虑注释和空格)C.接口体既可以有抽象方法,也可以有普通方法D.如果源代码中有main()方法,则该方法必须被放在代码的第一行
考题
下列描述中,正确的是______。A.finally代码段在发生异常时不一定必须执行B.异常机制可以用于流程控制C.在catch代码段中可以使用return语句来返回到异常抛出点D.可以把catch到的异常对象再次抛出,使上层try-atch结构继续处理该异常事件
考题
如下的代码段中,如果方法unsafe()正常运行,那么结果是( )。 public void example() { try { unsafe(); System.out.println("Testl"); }catch(SafeException e) { System.out.println("Test 2"); }finally{ System.out.println("Test 3'); } System.out.println("Test 4"); }A.Test 3 Test 4B.Test1 Test3 Test4C.Test1 Test3D.Test1 Test4
考题
在ASP中, VBScript有多种控制程序流程语句,如If…Then, Select… Case,For … Next, Do … Loop, Exit等语句。请为这五个语句分别写一段使用的代码。
考题
第二题:在ASP 中,VBScript有多种控制程序流程语句,如 If…Then, Select… Case,For … Next, Do … Loop, Exit等语句。请为这五个语句分别写一段使用的代码。
考题
在DO WHILE…ENDD0循环结构中LOOP语句的作用是( )。A.退出循环,返回到程序开始处B.终止循环,将控制转移到本循环结构ENDDO后面的第一条语句继续执行C.该语句在DO WHILE…ENDDO循环结构中不起任何作用D.转移到DO WHILE语句行,开始下一次判断和循环
考题
If the Charterer nominates an unsafe port and the ship is damaged through going there, ________ will be liable for the damage, subject to that the master acts reasonably in going there.A.heB.herC.the ownerD.the shipper
考题
If a port is in fact unsafe,it ______ irrelevant that well-informed men might have erroneously pronounced it to be safe.A.providesB.hasC.containsD.is
考题
下列关于抛出异常的描述中,错误的一项是()。A、异常可以由try代码段中的语句抛出B、异常可以从被try代码段中调用的方法中抛出C、异常的抛出并不影响代码段的执行顺序D、异常还可能产生于数组下标越界及Java虚拟机内部的错误等
考题
下列有关条件语句的叙述中错误的是()A、所有的IF语句均可以改用DO CASE语句来实现B、所有的DO CASE语句均可以改用IF语句来实现C、所有的IF语句均可以改用IIF()函数来实现D、IF语句和DO CASE语句均可以嵌套使用
考题
Which of the following is unsafe for a technician to use when troubleshooting or repairing a CRT monitor?()A、Anti-static padB、Anti-static wrist strapC、Rubber glovesD、Multimeter
考题
单选题If a port is in fact unsafe,it()irrelevant that well-informed men might have erroneously pronounced it to be safe.A
providesB
hasC
containsD
is
考题
单选题If the Charterer sends a vessel to an unsafe port,and she is damaged as a result,he will have to indemnify the().A
ReceiverB
Cargo ownerC
ShipownerD
Merchant
考题
单选题The main purpose of port State control is not to()A
prevent an unsafe ship proceeding to seaB
prevent a ship threatening the marine environmentC
fine the shipsD
confirm a safe sailing
考题
单选题在DO WHILE…ENDDO循环结构中LOOP语句的作用是( )。A
退出循环,返回到程序开始处B
终止循环,将控制转移到本循环结构ENDDO后面的第一条语句继续执行C
该语句在DO WHILE…ENDDO循环结构中不起任何作用D
转移到DO WHILE语句行,开始下一次判断和循环
考题
单选题下列关于抛出异常的描述中,错误的一项是()。A
异常可以由try代码段中的语句抛出B
异常可以从被try代码段中调用的方法中抛出C
异常的抛出并不影响代码段的执行顺序D
异常还可能产生于数组下标越界及Java虚拟机内部的错误等
热门标签
最新试卷