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+"颜色的新版手机可以听音乐");
      
     }
     
    }

  • 相关阅读:
    MSI文件静默安装
    C#文本文件或其他文件新内容追加
    VS2015在线安装包
    Hive创建表时添加中文注释后乱码问题
    scala获取字符串首字符和尾字符
    kafka topic常用命令
    supervisord实例配置
    pandas写数据进入数据库
    supervisord初体验
    python3 安装impyla相关的包
  • 原文地址:https://www.cnblogs.com/lyxcode/p/7240885.html
Copyright © 2011-2022 走看看