⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 instanceoftest.java

📁 《Java核心技术应用开发》电子工业出版社书籍源代码
💻 JAVA
字号:
package sample;

public class InstanceofTest {
    
    public static void main(String[] args) {
        Employee unknown = new Manager();
        Employee john = new Employee("john");
        System.out.println("unknown is instanceof manager: " + (unknown instanceof Manager));
        System.out.println("unknown is instanceof employee: " + (unknown instanceof Employee));
        System.out.println("john is instanceof manager: " + (john instanceof Manager));
        System.out.println("john is instanceof employee: " + (john instanceof Employee));
    }
    
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -