Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- computer
- react
- html
- Class
- MacOS
- mysql
- for
- Java
- DB
- while
- Pipelining
- DoM
- Algorithm
- control
- github
- web
- javascript
- DS
- MIPS
- architecture
- XML
- system
- function
- CSS
- python
- php
- instruction
- data structure
- DATAPATH
- Linux
Archives
- Today
- Total
목록throws (1)
YYYEJI
[JAVA] 예외처리(throws)란?
throws란? 자신을 호출하는 메소드에 예외처리의 책임을 떠넘기는 것입니다. throws 예제 코드입니다. public static void main(String[] args) { try { divideByZeroTest(20, 0); } catch (ArithmeticException e) { System.out.println("ArithmeticException: " + e.getMessage()); } } public static void divideByZeroTest(int a, int b) throws ArithmeticException{ System.out.println("The result is "+ a/b + "."); } - throws는 throw와 다르게 예외선언을 따로 하지 않아도..
Java
2022. 12. 27. 20:48