zoukankan      html  css  js  c++  java
  • 继承

    package com.jredu.ch06;
    
    public class Engineer {
        String no;
        String name;
        String time;
        
        public void ShowInfo(){
            System.out.println("我的编号:"+no+"我的姓名:"+name+"入职时间:"+time);
        }
        
        public Engineer() {
            super();
        }
    
        public Engineer(String no, String name, String time) {
            super();
            this.no = no;
            this.name = name;
            this.time = time;
        }
        
    }
    package com.jredu.ch06;
    
    public class SoftEngineer extends Engineer{
        String type;
        
        public SoftEngineer(String no, String name, String enterTime, String type) {
            super();
            super.no = no;
            super.name = name;
            super.time = enterTime;
            this.type = type;
        }
        @Override
        public void ShowInfo() {
            System.out.println("我的编号:"+no+"我的姓名:"+name+"入职时间:"+time+"种类:"+type);
        }
        public void coding(){
            System.out.println("我不是好人!");
        }
    }
    package com.jredu.ch06;
    
    public class SoftEngineerTest {
    
        public static void main(String[] args) {
            SoftEngineer softEngineer = new SoftEngineer("10001", "张三", "2016-08-05", "中文");
            softEngineer.ShowInfo();
            softEngineer.coding();
        }
    
    }

  • 相关阅读:
    网络面试题-1
    CentOS7下配置Squid代理
    docker使用harbor搭建私有仓库
    docker 基础命令
    docker要隔离的的6种namespace
    python 列表中的数字转为字符串
    python 排列组合
    filter函数
    Pytest配置文件声明自定义用例标识
    pytest参数化
  • 原文地址:https://www.cnblogs.com/xiaolei121/p/5740346.html
Copyright © 2011-2022 走看看