employeedemo.java

来自「在作业1的Employee和EmployeeDemo两个类基础上修改 1」· Java 代码 · 共 31 行

JAVA
31
字号
package com.totyuedu.c69.a20080829;

public class EmployeeDemo {
    public static void main(String[] args) {

        Employee john = new Salesman("John", 24, 3000, "010-68003277",
                "18# Yanan Road", "PG", "J1", "Zhang", 400000.0);

        Employee scott = new Engineer("Scott", 26, 4000, "010-28997700",
                "101# Xihu Road", "SL", "J2", "Liu", 8.5f);

        Employee lily = new Clerk("Lily", 29, 5000, "010-60987455",
                "101# Xihu Road", "PL", "ES", "Jin");

        Employee lily2 = new Clerk(new String("Lily"), 29, 5000,
                "010-60987455", "101# Xihu Road", "PL", "ES", "Jin");

        // it's must be return true;
        // if return false,the Employee's equals method must be wrong :-(
        System.out.println(lily.equals(lily2));

        
        
        System.out.println(john.getBonus());
        System.out.println(scott.getBonus());
        System.out.println(lily.getBonus());

    }

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?