Java多态或动态


Java多态或动态

class SuperClass {

   SuperClass get(){

      System.out.println("SuperClass");

      return this;

   }

}

public class Tester extends SuperClass {

   Tester get(){

      System.out.println("SubClass");

      return this;

   }

   public static void main(String[] args) {

      SuperClass tester = new Tester();



      tester.get();

   }   

}