由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - Java练习题 6
相关主题
Java练习题 7Tomcat JSP syntax error
Java练习题 2Problem on ANT,JAVA,JSP,JSPPrecompiler
Java练习题 12其实JSP也不错
Java 求解2Java练习题 1
Java练习题 4hibernate lazy-loading/ compile time instrumentation?
Re: unix环境下如何在java程序中执行命令行?When running a .jar file, error message: cannot connect to window server
问个Thread 的问题,java certificate里的Re: How can I call another program from Java?
Help with Tomcat for Eclipse v1.03Java runtime?
相关话题的讨论汇总
话题: url话题: error话题: compile
进入Java版参与讨论
1 (共1页)
u****s
发帖数: 2186
1
int i;
URL url = new URL("http://www.cnn.com");
BufferedInputStream in = new BufferedInputStream(url.openConnection(
).getInputStream());
while( (i=in.read())!=-1 )
{
System.out.print((char)i);
}
A. Compile error
B. Runtime error
C. print the text got from the URL
q*********u
发帖数: 280
2
B,
少了try catch?

int i;
URL url = new URL("http://www.cnn.com");
BufferedInputStream in = new BufferedInputStream(url.openConnection(
).getInputStream());
while( (i=in.read())!=-1 )
{
System.out.print((char)i);
}
A. Compile error
B. Runtime error
C. print the text got from the URL

【在 u****s 的大作中提到】
: int i;
: URL url = new URL("http://www.cnn.com");
: BufferedInputStream in = new BufferedInputStream(url.openConnection(
: ).getInputStream());
: while( (i=in.read())!=-1 )
: {
: System.out.print((char)i);
: }
: A. Compile error
: B. Runtime error

u****s
发帖数: 2186
3
ansume exception is handled correctly
q*********u
发帖数: 280
4
那就是c了
c的文字写的也不好,应该是print the html context which is from URL
print the text got from the URL , http://www.cnn.com也算是一种歧义了。
你如果贴题的话,搞点awt的或者swing的

int i;
URL url = new URL("http://www.cnn.com");
BufferedInputStream in = new BufferedInputStream(url.openConnection(
).getInputStream());
while( (i=in.read())!=-1 )
{
System.out.print((char)i);
}
A. Compile error
B. Runtime error
C. print the text got from the URL

【在 u****s 的大作中提到】
: int i;
: URL url = new URL("http://www.cnn.com");
: BufferedInputStream in = new BufferedInputStream(url.openConnection(
: ).getInputStream());
: while( (i=in.read())!=-1 )
: {
: System.out.print((char)i);
: }
: A. Compile error
: B. Runtime error

1 (共1页)
进入Java版参与讨论
相关主题
Java runtime?Java练习题 4
Re: 怎么能是JAVA里的数组开的更大?Re: unix环境下如何在java程序中执行命令行?
JAVA RUNTIME.EXEC 一问问个Thread 的问题,java certificate里的
Java program running on PDAHelp with Tomcat for Eclipse v1.03
Java练习题 7Tomcat JSP syntax error
Java练习题 2Problem on ANT,JAVA,JSP,JSPPrecompiler
Java练习题 12其实JSP也不错
Java 求解2Java练习题 1
相关话题的讨论汇总
话题: url话题: error话题: compile