皮皮学,免费搜题
登录
搜题
【简答题】
阅读下列Java程序说明,将应填入(n)处的字句写在对应栏内。 【说明】本程序ExceptionTester实现功能:读入两个整数,第1个数除以第2个数,之后输出。若第2个数为0,则自动进行异常处理。 程序如下: (1); public class ExceptionTester{ public static void main(String args[]){ int result; int number[]=new int[2]; boolean valid; for(int i=0;i<2;i++){ valid=(2); while(!valid){ try{ System.out.println('Enter number'+(i+1)); number[i]=Integer.valueOf(Keyboard.getString()).intValue(); valid=true; }catch(NumberFormatExceptione){ System.out.println('Invalid integer entered.Please try again.'); } } } by{ result=number[0]/number[1]; System.out.print(number[0]+'/'+number[1]+'='+result); }catch((3)){ System.out.println('Second number is 0,cannot do division!'); } } } 其中,Keyboard类的声明为: impon java.io.*; public class Keyboard{ static BufferedReader inputStream=new (4) (new InputStreamReader(System.in)); public static int getInteger(){ try{ return(Integer,valueOf(inputStream.readLlne().trim()).intValue()); }catch(Exceptione){ e.printStackTrace(); return 0; } } public (5) { by{ return(inputStream.readLine()); } catch(IOExceptione) {return '0';} } }
拍照语音搜题,微信中搜索"皮皮学"使用
参考答案:
参考解析:
知识点:
.
..
皮皮学刷刷变学霸
举一反三
【单选题】船舶以极近距离驶过系泊船时,系泊船受驶过的船的作用以及发散兴波被岸壁反射后对船体的作用,会产生首摇,横摇,纵摇,纵荡,横荡,垂荡,关于这种影响,下列说法正确的是()。
A.
水深越浅,影响越小
B.
航速越低,影响越小
C.
系泊船排水量越小,影响越小
D.
驶过船排水量越大,影响越大
【多选题】If you go to a fine dining, you will probably need to ________________________ .
A.
wear T-shirts
B.
wear shirts
C.
wear jeans
D.
wear suits
E.
book in advance
【单选题】Will you go to the Great Wall if it fine Tomorrow.
A.
will
B.
was
C.
is
D.
is going to
【单选题】Will you go to the Great Wall if it ____ fine tomorrow?
A.
will
B.
was
C.
is going to be
D.
is
【单选题】— How do you usually go to work? — If it is fine, I _____ on foot. [     ]
A.
will go
B.
go
C.
have gone
D.
won't go
【单选题】船舶以极近距离驶过系泊船时,系泊船受驶过的船的作用以及发散兴波被岸壁反射后对船体的作用,会产生首摇,横摇,纵摇,纵荡,横荡,垂荡,关于这种影响,下列说法正确的是()。
A.
水深越浅,影响越大
B.
航速越低,影响越大
C.
系泊船排水量越大,影响越大
D.
驶过船排水量越小,影响越大
【单选题】船舶以极近距离驶过系泊船时,受驶过船的兴波作用以及发散波被岸壁反射后对船体的作用,系泊船会产生( )。1首摇,纵荡;2横摇,垂荡;3横荡,纵摇。
A.
①②③
B.
②③
C.
①③
D.
①②
【单选题】If you enjoy fine food and wines, you can go to ______ in Beijing World Trade Center.
A.
a German bar
B.
a Karaoke room
C.
Ground Level
D.
Basement 1
【单选题】-Would you like out for a picnic tomorrow? -Yes, if the weather is fine tomorrow. [     ]
A.
to go
B.
go to
C.
go
D.
going
【单选题】计算机系统总线包括①地址总线、②数据总线和③控制总线。若采用DMA方式传送数据,需要DMA控制器控制的是( )。
A.
①②
B.
②③
C.
①③
D.
①②③
相关题目: