Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Extending abstract classes

630556Dec 18 2008 — edited Dec 18 2008
I just have a simple question. I have one class which is abstract
public abstract class Person
{
	private String firstName; 
	private String lastName;
	private String title;
	private String dateOfBirth;
	private String homeAddress;
	private String phoneNumber;
	
	public static final String MR = "Mr";
	public static final String MISS = "Miss";
	public static final String MS = "Ms";
	public static final String MRS = "Mrs";
	public static final String DR = "DR";
	public static final String PROF = "Prof";


	public Person(String firstName, String lastName, String title, String dateOfBirth, 
			      String homeAddress, String phoneNumber){
			      	
		this.firstName=firstName;
		this.lastName=lastName;
		this.title=title;
		this.dateOfBirth=dateOfBirth;
		this.homeAddress=homeAddress;
		this.phoneNumber=phoneNumber;
		
	}
	
And i have another class which extends this class
public abstract class Borrower extends Person{
	
  public LibraryItem [] itemsBorrowed;
  private double currentFine;
  private int barCode;
 
  public LibraryItem [] getItemsBorrowed()
  {
  	return itemsBorrowed;
  }

  public double getCurrentFine()
  {
  	return currentFine;
  }
    
  public int getBarCode()
  {
  	return barCode;
  }
When i try to compile these two classes, i get the error
Cannot find symbal constructor Person(). The problem is that the tutor hates us providing default constructors, and i presume that this is what the error is asking for. Is there any way around this or does a default constructor need to be povided?
cheers
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 15 2009
Added on Dec 18 2008
14 comments
319 views