본문 바로가기



프로그래밍/JAVA

[JAVA] The constructor BufferedInputStream(FileInputStream) is undefined

new BufferedInputStream(input_si_pm_kicked);

The constructor BufferedInputStream(FileInputStream) is undefined

BufferedInputStream 을 이용하여 파일입력을 받을려 고 하는데 ctrl+shift+o를 해도 import 되지 않고, 임의로 import를 작성해도 에러가 발생되어 곰곰히 찾아보니 해당 클래스 파일의 이름이 또, object이름과 같게해서 일어난 문제였다. IDE에서 패키지명, 클래스명과 동일한 클래스파일 작성시 경고를 내보내면 좋겠는데. 지금까지 딱 두번 이런문제로 시간을 소모한게 안타깝다. 

아래 메시지가 현재 상황에서 import를 수동으로 입력하면 나타나는 메시지이다. 한마디로 셋트로 에러가 나는것.

import java.io.BufferedInputStream;

The import java.io.BufferedInputStream conflicts with a type defined in the same file

 

똑같은 원인으로 에러가 발생한 경우가 있었다. 아래 링크 참조

[JAVA] No exception of type NumberFormatException can be thrown; an exception type must be a subclass of Throwable

 

[JAVA] No exception of type NumberFormatException can be thrown; an exception type must be a subclass of Throwable

강좌를 수강하다보니 예외처리할때 catch 쪽에 분명 오류코드를 넣었는데 실행되지 않고, 구문 에러가 계속 나오는경우로 해당 코드실행시 나오는 에러문구는 "No exception of type NumberFormatException ca

fmri.tistory.com