Interface1 인터페이스(interface) 인터페이스(interface)설계 표준클래스가 따라야할 최소한의 공통 규칙을 정의세부 구현은 각 클래스에 맡김 인터페이스 적용implements 키워드로 활용 가능인터페이스를 구현한 클래스를 구현체라고 함interface Animal { void eat();}class Bird implements Animal { @Override void eat() // 인터페이스 규칙 { System.out.println("곡물을 먹는다"); } void fly() // Bird 클래스만의 기능 { System.out.println("하늘을 난다."); }}class Dog implements Animal { @Override .. 2026. 6. 4. 이전 1 다음