2011년 2월 28일 월요일

static modifier

static 제한자는 메소드나 변수를 메모리에 로딩 시켜 여러 인스턴스들이 공유할 수 있도록 하기 위해서 사용

static 제한자가 선언된 메소드나 변수는 객체를 생성하지 않고도 접근 할 수 있음

ststic 제한자로 선언된 메소드는 하위 클래스(상속을 받은 클래스)에서 static 제한자가 없는 메소드로 overriding(오버라이딩) 할 수 없으며 반대로 일반 메소드(static 선언되지 않은 메소드)를 하위클래스에서 static 제한자로 선언된 메소드로 재정의 할 수도 없다.

static 멤버는 top-level(가장 외부) 클래스 또는 static 제한자로 선언된 클래스에만 선언될 수 있다.

static 제한자를 지역 변수에 선언 할 경우에 에러 발생

간단히... 메모리에 존재하게 해 주는 키워드. malloc, calloc이랑 같다.

댓글 없음:

댓글 쓰기

국정원의 댓글 공작을 지탄합니다.

UPBIT is a South Korean company, and people died of suicide cause of coin investment.

 UPBIT is a South Korean company, and people died of suicide cause of coin. The company helps the people who control the market price manipu...