1. 객체 지향 프로그래밍

2. 클래스 이름 규칙
- 첫 글자는 무조건 ‘대문자’
3. 메서드 생긴 꼴

- 메서드 이름 (){}
4. 자바 실행 원리

(1) .java → .class 컴파일

(2) static을 찾는다. (디버깅)
package ex01;
public class Var01 { // 1. 클래스 이름 (오브젝트)
public void main(String[] args) { // 2. 메서드 (행위) 3. main (메서드 이름)
int n1 = 10;
System.out.println(n1);
}
}

(3) main을 실행한다. (디버깅)
package ex01;
public class Var01 { // 1. 클래스 이름 (오브젝트)
public static void main2(String[] args) { // 2. 메서드 (행위) 3. main (메서드 이름)
int n1 = 10;
System.out.println(n1);
}
}

(4) 성공
package ex01;
public class Var01 { // 1. 클래스 이름 (오브젝트)
public static void main(String[] args) { // 2. 메서드 (행위) 3. main (메서드 이름)
int n1 = 10;
System.out.println(n1);
}
}

5. 자바의 생명 주기
- main의 시작부터 끝까지
- { : 시작
- } : 끝
Share article