本帖最后由 沈文杰 于 2013-3-10 16:35 编辑
- abstract class Employee
- {
- private String name;
- private String id;
- private double pay;
- Employee(String name,String id,double pay)
- {
- this.name = name;
- this.id = id;
- this.pay = pay;
- }
- public abstract void work();
- }
- class Manager extends Employee
- {
- private double bonus;
- Manager(String name,String id,double pay,double bonus)
- {
- super(name,id,pay);
-
- this.bonus = bonus;
- }
- public void work()
- {
- System.out.println("manager work");
- }
- }
- public class AbstractClass {
- public static void main(String[] args){
- Manager ma = new Manager("zhangsan","kasdf",12233,10000.1);
- ma.work();
-
- }
- }
复制代码 哥们你代码错误好多啊,不是用MyEclipse编译的吧。。真心不懂你怎么过的啊 |