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();
        }
    
    }

  • 相关阅读:
    matplotlib
    python 面向对象(进阶篇)转载武沛齐
    Python 面向对象(初级篇)
    jupter nootbok 快捷键、NumPy模块、Pandas模块初识
    爬虫系列之mongodb
    python迟邦定
    爬虫之selenium模块
    爬虫数据解析的三方式
    爬虫之requests模块
    315题
  • 原文地址:https://www.cnblogs.com/xiaolei121/p/5740346.html
Copyright © 2011-2022 走看看