본문 바로가기
카테고리 없음

[java]@SuppressWarnings 란?

by dokii 2022. 9. 15.
728x90
반응형

Java의 @SuppressWarnings은 경고를 제외시킬 때 사용한다.

 

아래와 같이 사용하면 된다.

@SuppressWarnings({"rawtypes", "unchecked"}) 
public static haha() throws Exception {
		내용
}

 

 

all : 모든 경고  

cast : 캐스트 연산자 관련 경고

dep-ann : 사용하지 말아야 할 주석 관련 경고

deprecation : 사용하지 말아야 할 메서드 관련 경고

fallthrough : switch문에서 break 누락 관련 경고

finally : 반환하지 않는 finally 블럭 관련 경고

null : null 분석 관련 경고

rawtypes : 제너릭을 사용하는 클래스 매개 변수가 불특정일 때의 경고

unchecked : 검증되지 않은 연산자 관련 경고

unused : 사용하지 않는 코드 관련 경고

 

 

 

참고한블로그

https://solbel.tistory.com/209 [개발자의 끄적끄적:티스토리]

728x90
반응형

댓글