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

  • 相关阅读:
    mongoDb
    profile ,explain,
    header 里面的contenttype
    group by,distinct的使用(30万数据测试)
    ubuntu 12.04 mysql 错误 Errcode 13
    php curl,爬虫
    explain mysql
    php 文件的函数
    create User,grand,Load data file
    android 按钮点击测试
  • 原文地址:https://www.cnblogs.com/xiaolei121/p/5740346.html
Copyright © 2011-2022 走看看