|
|
|
|
|
|
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
|
|
|
|
|
|