1. 객체 지향 프로그램

2. 클래스 이름 규칙
- class를 만들 때 첫 글자는 반드시 대문자로 한다
3. 메서드 생긴 꼴
() {} >> 메서드

4. 자바 실행 원리

4-1 검증 과정
(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. 자바의 생명주기

Share article