표준입력 (stdin)
실행옵션 (runtime option)
코드:
실행 »
표준입력/실행옵션
class Parent { } class Child extends Parent { } class Brother extends Parent { } public class prog { public static void main(String[] args) { Parent p = new Parent(); System.out.println(p instanceof Object); // true System.out.println(p instanceof Parent); // true System.out.println(p instanceof Child); // false System.out.println(); Parent c = new Child(); System.out.println(c instanceof Object); // true System.out.println(c instanceof Parent); // true System.out.println(c instanceof Child); // true } }