Posted by °½Åµ¿ on July 16, 1997 at 22:13:38:
In Reply to: throws¿¡ ´ëÇؼ posted by ÀÌ°æÇÏ on July 16, 1997 at 18:40:24:
¾È³çÇϼ¼¿ä °½Åµ¿ÀÔ´Ï´Ù.
>ÈÀÏÀÇ ³»¿ëÀº
>//
>import ListOfNumbers;
>class ListofNumbersTest{
>public static void main(String args[]){
>ListOfNumbers list = new ListOfNumbers();
>list.writeList():
>}
>}
>ÀÔ´Ï´Ù.
>±×·±µ¥,list.writeList()¿¡¼ ¿¡·¯°¡ ³³´Ï´Ù.
>¿¡·¯¸Þ¼¼Áö´Â
>Exception java.io.IOException must be caught. or it use be
>declared in the throws clause of this method.
¿¡·¯ ¸Þ¼¼Áö¿¡¼ ¸»ÇÏ´Â ¹Ù¿Í °°ÀÌ Àâ¾ÆÁÖ¾î¾ß ÇÕ´Ï´Ù.
import ListOfNumbers;
class ListofNumbersTest{
public static void main(String args[]){
ListOfNumbers list = new ListOfNumbers();
try {
list.writeList():
}
catch (IOException e) {}
}
}
catchµÚ¿¡ ÀÖ´Â {} ³»ºÎ¿¡ ExceptionÀÌ ÀϾ¶§
ó¸®ÇÏ´Â ÇÁ·Î±×·¥À» Áý¾î³Ö¾îÁÝ´Ï´Ù.
¾Æ¹«°Íµµ ½áÁÖÁö ¾ÊÀ¸¸é ExceptionÀÌ ¹ß»ýÇÏ¿©µµ
¾Æ¹«·± Àϵµ ÇÏÁö ¾Ê½À´Ï´Ù.
Ä¿´Ù¶õ ÇÁ·Î±×·¥À» ÀÛ¼ºÇÒ °æ¿ì¿¡´Â ÇÁ·Î±×·¥ÀÌ ¸ØÃßÁö
¾Êµµ·Ï ExceptionÀ» ó¸®ÇÒ ¼ö ÀÖ´Â ÇÁ·Î±×·¥À»
³Ö¾îÁÖ¾î¾ß ¾ÈÁ¤ÇÑ ÇÁ·Î±×·¥ÀÌ µË´Ï´Ù.
Âü°í°¡ µÇ¼Ì±æ ¹Ù¶ø´Ï´Ù.
½Ã°£ÀÌ ³ª½Ã¸é
Java Developer Group Web BBS
¿¡µµ µé·ÁÁֽþî ÁÁÀº ¸»¾¸ ºÎŹµå¸³´Ï´Ù.