티스토리 뷰
- NullPointerException
Exception in thread "main" java.lang.NullPointerException
at com.kh.example.chap02.loop.C_DoWhile.method(C_DoWhile.java:21)
at com.kh.example.chap02.run.Run.main(Run.java:36)
- 에러 내용 : null은 아무것도 아닌데 도대체 무엇을 가지고 오라는 거냐
- 해결 방법 : String str = "";
- ArrayIndexOutOfBoundsException
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 9
at com.kh.example.array.A_Array.method1(A_Array.java:65)
at com.kh.example.run.Run.main(Run.java:9)
- 에러 내용 : 존재 하지 않는 인덱스에 100이라는 값을 집어넣겠다고 했기 때문에, array에 대해 index가 9번째로 넘쳤다
- 해결 방법 : 정해진 배열(array)길이를 초과하면 해당 에러가 뜨기 때문에 해당 arr[9] = 100;을 주석처리 해주자.
- 위치 : A_Arraypackage com.kh.example.array; public class A_Array{}
'트러블 슈팅 🥤' 카테고리의 다른 글
[Tomcat] 톰캣 서버 실행 오류 - Specified class is an interface (1) | 2023.05.09 |
---|---|
Refused to apply style from 'http://localhost:8080/css/main.css' because... (0) | 2023.05.09 |
[공유] [IntelliJ] 인텔리제이 콘솔 한글 출력 깨짐 (0) | 2022.10.31 |
🕵️♂️ '컴퓨터가 클래스를 못 찾는다' 시리즈 (0) | 2022.10.25 |
[에러 창고] Error: Could not find or load main class com.fastcampus.ch2.YoilTeller (0) | 2022.10.18 |
댓글
공지사항