728x90 자바 인터페이스1 [JAVA] ch07-20. 객체 지향 20 public class Ex20 { public static void main(String[] args){ Fighter fighter = new Fighter(); if(fighter instanceof Thing) //fighter는 Thing에 소속되어있다.. (true)이므로 출력. System.out.println("fight instanceof Thing"); if(fighter instanceof Fightable) //fighter is instance of Fightable. System.out.println("fight instanceof Fightable"); if(fighter instanceof Movable) System.out.println("fight instanceof Mo.. JAVA/예제 2017. 8. 22. 이전 1 다음 728x90