You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Learn/Jb28_AbstractTest.java

49 lines
736 B

public class Jb28_AbstractTest
{
public static void main(String[] args)
{
System.out.println("Hello World!");
}
}
abstract class Staff
{
private String name;
private String id;
private double pay;
Staff(String name,String id,double pay)
{
this.name = name; //<2F><>ʼ<EFBFBD><CABC>
this.id = id;
this.pay = pay;
}
public abstract void work();
}
class Programmer extends Staff
{
Programmer(String name,String id,double pay)
{
super(name,id,pay);
}
public void work()
{
System.out.println("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
}
}
class Manager extends Staff
{
private int bonus;
Manager(String name,String id,double pay,int bonus)
{
super(name,id,pay);
this.bonus = bonus;
}
public void work()
{
System.out.println("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ա");
}
}