[Java] 1. 자바의 특징

김주희's avatar
Feb 03, 2025
[Java] 1. 자바의 특징
 

1. 객체 지향 프로그래밍

notion image
 

2. 클래스 이름 규칙

  • 클래스 이름 = 오브젝트 이름
  • 규칙) 첫 글자는 대문자여야 한다.(소문자일 경우 실행X)

3. 메서드 형태

notion image
메서드명() {}

4. 자바 실행 원리

notion image
 

(1) .java → .class 컴파일

notion image
notion image
 

(2) static 찾기(디버깅)

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

(3) main 실행(디버깅)

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

(4) 성공

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

5.자바의 생명 주기

main의 시작( ‘{’ )부터 끝( ‘}’ )까지
 
Share article

jay0628