Posted by ¹ÚÁø¿ì on June 11, 1997 at 16:06:22:
¾È³çÇϽʴϱî
¹ÚÁø¿ì ÀÔ´Ï´Ù.
Á¦°¡ ¾Ë°í ÀÖ±â·Î´Â try¿¡ ´ëÇÏ¿© ¿©·¯°³ÀÇ catch ¹®À» µÑ ¼ö ÀÖ´Â °ÍÀ¸·Î ¾Ë°í Àִµ¥
¾Æ·¡ ¿¹Á¦¸¦ compile ÇѸé catch not reached¶ó´Â error ³³´Ï´Ù.
ÀÌ°ÍÀÌ »õ·Î ¹Ù²ï ³»¿ëÀÎÁö ¾Æ´Ï¸é Á¦°¡ À߸ø ¾Ë°í ÀÖ´Â °ÇÁö..
1.1.final¿¡¼´Â µÇ¾ú´ø ±â¾ïÀÌ ³ª´øµ¥.....ÂÁ
±×·³ ¼ö°íÇϽʽÿä...
¿¹:)
import java.net.*;
import java.io.*;
public class URLOpenStreamTest
{ public static void main(String[] args)
{ String line;
URL url;
try
{ url = new URL("http://www.javasoft.com/");
DataInputStream html = new DataInputStream(url.openStream());
while((line = html.readLine()) != null)
{ System.out.println(line);
}
}
catch(IOException e1)
{ e1.printStackTrace(); }
catch(MalformedURLException e2)
{ e2.printStackTrace(); }
}
}