728x90
๋ฐ˜์‘ํ˜•

Java ๊ธฐ์ดˆ ๊ณต๋ถ€๋ฅผ ๋‹ค์‹œ ํ•˜๋Š” ๋„์ค‘์— 

 

No exception of type Exception can be thrown; an exception type must be a subclass of Throwable

 

์ด๋Ÿฌํ•œ ์˜ค๋ฅ˜๋ฅผ ๋งŒ๋‚ฌ๋‹ค. ์™œ ์ด๋Ÿฐ ์˜ค๋ฅ˜๊ฐ€ ๋–ด๋Š”์ง€ ํ™•์ธํ•˜๋‹ˆ ํด๋ž˜์Šค ํŒŒ์ผ ์ด๋ฆ„์— Exception ์„  try  ~ catch ๋ฌธ์—  catch(Exception e)์œผ๋กœ ์ธํ•ด ์˜ค๋ฅ˜๊ฐ€ ๋‚œ ๊ฒƒ์ด๋‹ค. ํด๋ž˜์Šค ํŒŒ์ผ ์ด๋ฆ„์„ Exception01๋กœ ๋ฐ”๊พธ๋‹ˆ ์ด๋Ÿฌํ•œ ์˜ค๋ฅ˜๊ฐ€ ์‚ฌ๋ผ์กŒ๋‹ค.

์•ž์œผ๋กœ ํด๋ž˜์Šค ํŒŒ์ผ๋ช…๊ณผ try ~ catch ๋ฌธ์— ๋“ค์–ด๊ฐ€๋Š” ํด๋ž˜์Šค๋ช…์„ ์กฐ์‹ฌํ•˜๋ฉด์„œ ์จ์•ผ๊ฒ ๋‹ค.

728x90
๋ฐ˜์‘ํ˜•

+ Recent posts