인터페이스

    자바 추상 클래스와 인터페이스

    추상클래스 -추상메소드 Abstract Method 선언부만 가지는 메소드 accessModifer 반환타입 메소드이름(매개변수) -추상클래스 적어도 하나의 추상메소드를 가지는 클래스 *객체 생성에 사용 불가 *상속에 이용 *참조 변수의 타입으로 사용 가능 인터페이스 public interface 인터페이스이름 [extends superinterface]{ 상수 abstract methods default methods - body 있음 static methods - body 있음 } accessModifer class 클래스 implements 인터페이스{ body } -구현 클래스는 인터페이스의 상수, default method, static method를 상속함 -abstract method를 구현..