zoukankan      html  css  js  c++  java
  • 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+"颜色的新版手机可以听音乐");
      
     }
     
    }

  • 相关阅读:
    融资担保公司
    典当公司
    保险代理、经纪公司互联网保险
    财产、人身、养老保险公司
    105家基金子公司
    LogStash Download
    cmd使用管理员权限运行,启动路径不是当前目录
    Module controller in JMeter
    Elasticsearch-->Get Started--> Exploring Your Data
    What are the differences between Flyweight and Object Pool patterns?
  • 原文地址:https://www.cnblogs.com/lyxcode/p/7240885.html
Copyright © 2011-2022 走看看