220928 static 변수

Jongleee·2022년 9월 29일
1

TIL

목록 보기
65/564

static 변수

  • 객체를 생성하지 않고도 Static 자원에 접근이 가능

  • 기존방식

    private final Class class;
    	class.method()

    과 같은 형태로 객체를 생성한 후 사용

  • static

    public static void method()

    와 같이 static 메소드를 사용하면

    Class.method()
    	class.method()

    객체 생성 없이 바로 사용 가능

0개의 댓글