Class(클래스)
클래스의 구성 요소
class Ogu {
// 속성(property)
int height;
int weight;
int age;
// 기능(function), 메서드(method)
void eat() {
// ...
}
void sleep() {
// ...
}
}인스턴스 생성과 사용
변수
종류
선언 위치
생성 시기
특징
메서드
return
static 메서드(클래스 메서드)
오버로딩(Overloading)
생성자(Constructor)
생성자 실행 과정
생성자
변수 초기화
멤버변수 초기화 시기와 순서
-
cv
iv
내부 클래스(Inner Class)
클래스 유형
설명
외부 클래스 필드 접근
외부 클래스 생성 필요
특징
static inner class vs inner class
메모리 누수 (Memory Leak) 위험
Last updated