"자바 키워드 implements"의 두 판 사이의 차이

(새 문서: ==개요== ;implements * 인터페이스를 상속할 때 사용하는 자바 키워드 <syntaxhighlight lang='java' run multi=1 file=Animal.java> interface Animal { public voi...)
 
잔글 (Jmnote님이 Implements 문서를 자바 implements 문서로 이동했습니다)
(차이 없음)

2022년 4월 29일 (금) 12:59 판

1 개요

implements
interface Animal {
  public void animalSound();
}
class Duck implements Animal {
    public void animalSound() {
        System.out.println("Quack");
    }
}
public class MyClass {
    public static void main(String[] args) {
        Animal a = new Duck();
        a.animalSound();
    }
}

2 같이 보기

3 참고

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}