第1题
A.sleep(1000)
B.t.sleep(1000)InterruptedExceptionInterruptedException
C.Thread.sleep(1000)
D.Thread.sleep(1000)RuntimeExceptionInterruptedException
第2题
A.sleep(1) RuntimeException
B.t.sleep(1000) InterruptedException
C.Thread.sleep(1) InterruptedException
D.Thread.sleep(1000) InterruptedException
第3题
A.sleep(1) RuntimeException
B.t.sleep(1000) InterruptedException
C.Thread.sleep(1) InterruptedException
D.Thread.sleep(1000) InterruptedException
第4题
A.sleep(1000) InterruptedException
B.t.sleep(1000) InterruptedException
C.Thread.sleep(1000) RuntimeException
D.Thread.sleep(1000) InterruptedException
第5题
A.sleep(1000); InterruptedException
B.t. sleep(1000); InterruptedException
C.Thread. sleep(1000); RuntimeException
D.Thread. sleep(1000); InterruptedException
第7题
注意:请勿改动main()主方法和其他已有的语句内容,仅在下画线处填人适当的语句。
import java.io.*;
public class FileCopyBy{
public static void main(String args[]){
try{
FileReader input=new FileReader("README.txt");
FileWriter utput=new FileWriter("temp.txt");
int c=input.read();
while(__________)
{
__________
System.out.print((char)c);
c=input.read();
}
input.close();
output.close();
}
catch(IOException e)
{
System.out.println(e);
}
}
}
第8题
A.sleep(1000)
B.t.sleep(1000)InteruptedException InterruptedException
C.Thread.sleep(1000)
D.Thread.sleep(1000)RuntimeException InterruptedException
第9题
【说明】
下面程序完成从键盘读入一个字符串,然后采用parseInt方法将其转换为一个相应的整数。
import java.io.*;
public class testThrows{
public static (1) readString() (2) IOException{
int ch;
String r="";
boolean done=false;
while((3)){
ch=System.in.read();
if(ch<0 || ch=0xd) //处理回车符中第一个符号
done=true;
else
r=r+(char)ch;
}
return r;
}
public static void main(Stling args[]){
String str;
(4) {
str=readString();
} (5) (IOException e){
System.out.println("error");
return;
}
System.out.println("input integer: "+Integer.parselnt(str));
}
}
第10题
A.sleep(1000) InterruptedException
B.t.sleep(1000) InterruptedException
C.Thread.sleep(1000) RuntimeException
D.Thread.sleep(1000) InterruptedException
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!