변수의 초기화
class InitTest {
int x; //인스턴스 변수(자동초기화)
int y = x; //인스턴스 변수
void method1() {
int j; //지역 변수
int j = i //에러. 지역변수를 초기화하지 않고 사용
}
멤버 변수의 초기화
class Car {
int door = 4; //기본형 변수(primitive type)의 초기화
Engine e = new Engine(); //참조형 변수(reference type)의 초기화
}
Car(String color, String gearType, int door) {
`this.color = color;`
this.gearType = gearType;
this.door = door;