package CHAPTER02;

public class C2_07_TypeCastingExample { 
	
    public static void main(String[] args) {
    	
        // 자동 형변환 (작은 타입 → 큰 타입)
        int intValue = 100; // 정수형 변수 선언
        double doubleValue = intValue; // int → double 자동 형변환
        System.out.println("자동 형변환: " + doubleValue); // 결과 출력

        // 강제 형변환 (큰 타입 → 작은 타입)
        double decimal = 9.75; // 실수형 변수 선언
        int rounded = (int) decimal; // double → int 강제 형변환 (소수점 버림)
        System.out.println("강제 형변환: " + rounded); // 결과 출력
    }
}
