Warning-The static field StaticEx02.s2 should be accessed in a static way

CODEDRAGON Development/Java

반응형

   

   

경고 메시지

The static field StaticEx02.s2 should be accessed in a static way

  

   

   

원인

Static 변수를 클래스이름을 이용한 접근방법이 아닌

객체생성 후 인스턴스을 통해 접근할 경우 발생합니다.

   

   

   

해결방법

클래스명을 통한 접근방법으로 변경

   

반응형

'Development > Java' 카테고리의 다른 글

ConsoleOutputEx05-서식문자 확인  (0) 2015.08.17
ConsoleInputEx04-next() vs nextLine()  (0) 2015.08.16
public static void main( )  (0) 2015.08.13
상속, 인스턴스  (0) 2015.08.12
ConsoleInputEx05-입력 버퍼 비우기  (0) 2015.08.11