User:Zzzsean/sandbox

// Class that illustrate the use of abstract classes

public abstract class Employee extends Person { private String companyName;

public Employee(String name,String address,int age,String companyName) {	super(name, address, age); this.companyName = companyName; } public Employee{ }	public String getcompanyName{ return companyName; } public void setcompanyName(String companyName){ this.companyName = companyName; } public String toString { return super.getName+" "+super.getAddress+" "+super.getAge; }	public boolean equals(Object obj) { if(obj instanceof Person) { Person c=(Person) obj; if(c.getName == this.getName && c.getAddress == this.getAddress && c.getAge == this.getAge) return true; }			return false; } public string getcompanyName{ return companyName;

/* abstract method that should be implemented by classes extending this class note that we can not compute earnings here since at this point, the class has no information regarding salary */

public abstract double earnings;

}

http://web.a.ebscohost.com/ehost/detail/detail?vid=2&sid=ac961280-00e5-4204-b140-73eb1ab9c9cd%40sessionmgr4004&hid=4207&bdata=JnNpdGU9ZWhvc3QtbGl2ZQ%3d%3d#AN=DA013100&db=funk

http://worldbookonline.com/student/article?id=ar722712&st=database#tab=homepage