polytest.java

来自「这个是学习网络编程的好好文档! 里面有一些老师发给的学习jsp的课件!」· Java 代码 · 共 29 行

JAVA
29
字号
class Emp{
  public void hi(){System.out.println("Hi,Emp!");}
}
class Temp extends Emp{
  public void hi(){System.out.println("Hi,Temp!");}
}
class Mang extends Emp{
  public void hi(){System.out.println("Hi,Mang!");}
}
class CorpOff extends Mang{
  public void hi(){System.out.println("Hi,CorpOff!");}
}

class PloyTest{
  public static void main(String args[])
  {
    Emp t;
    
    t = new Emp();
    t.hi();
    t = new Temp();
    t.hi();
    t = new Mang();
    t.hi();
    t = new CorpOff();
    t.hi();
  }
}
    

⌨️ 快捷键说明

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