• java lesson09总结


    package Super;

    public class SuperTest {
     
     
    String color;
     
     //
     public SuperTest(String color)
     {this.color=color;
      
     }
     public SuperTest()
     {
      
     }
     
    /*String name ="小明";
     public SuperTest()
     {
      System.out.println("父类构造方法");
      
     }
     
     
     public SuperTest(String name )
     {
      System.out.println("父类构造方法......."+name);
      
     }
     
     void main()
     {System.out.println("父类方法!!!");
      
      
      
     }
     
     */
     void telPhone()
     {
      
      
      System.out.println("使用旧版手机打电话");
      
     }
    }

    package Super;

    public class Mian {public static void main(String[] args)
    {SuperTest st=new SuperSon("白色");
    st.telPhone();
    SuperSon stt=(SuperSon)st;
    stt.listenMusic();

    }


    }

    package Super;

    public class SuperSon extends SuperTest{
     String color;
     
     //
     public SuperSon(String color)
     {this.color=color;
      
     }
     
     
     
     
     
    /* 
     String name="小强";
     public SuperSon(String name )
     {super("小明");
      System.out.println("子类构造方法./////"+name);}
     
     void main()
     {
      super.main();
      System.out.println("子类方法!!!");
     }
     
     

     public static void main(String [] args)
     {
      SuperSon ss=new SuperSon("小强");
      
      ss.main();
      
     }*/
     
     void telPhone()
     {
      System.out.println("使用"+color+"新版手机打电话");
      
     }
     void listenMusic()
     {
      System.out.println(color+"颜色的新版手机可以听音乐");
      
     }
     
    }

  • 相关阅读:
    access 导数据到sql server 2008
    axis2 调用.net基于https的WebService接口
    android layout 属性大全
    sqlite-manager
    android Permission 访问权限许可
    ImageSwitcher 右向左滑动的实现方式
    java 全角半角转换函数
    Delphi中使用Office中VBA的优缺点
    Delphi中控制VBA 宏
    Delphi 与 Word_VBA
  • 原文地址:https://www.cnblogs.com/lyxcode/p/7240885.html
Copyright © 2020-2023  润新知