personStudent.java:6: cannot find symbol
symbol : constructor Person(java.lang.String,int)
location: class Person
super(theName, theAge);
^
personStudent.java:6: cannot find symbol
symbol : constructor Person(java.lang.String,int)
location: class Person
super(theName, theAge);
^
the code i have written for the two programs is below...any help would be much appreciated.
thanks **Luke**
PERSON CLASS
[codebox]
public class Person
{
protected String name;
protected int age;
public void setName (String theName)
{
name = theName;
}
public void setAge (int theAge)
{
age = theAge;
}
public String getName ()
{
return name;
}
public int getAge ()
{
return age;
}
public void displayDetails ()
{
System.out.println("Name is : " + name );
System.out.println("Age is : " + age );
}
}
[/codebox]
STUDENT_PERSON CLASS
[codebox]
public class personStudent extends Person
{
private int studentNo ;
public personStudent (String theName, int theAge, int num)
{
super(theName, theAge);
studentNo = num;
}
public int getStudentNo()
{
return studentNo;
}
public int setStudentNo()
{
studentNo = num;
}
public void displayDetails ()
{
super.displayDetails();
System.out.println("Student Number Is: " + studentNo);
}
}
[/codebox]
TEST CLASS
[codebox]
public class TestPerson
{
public static void main(String []args)
{
System.out.println("Testing Person class");
System.out.println("---------------------------------------");
// instantiating the class
// constructing an object of type Person
Person Ryan = new Person();
Person Luke = new Person();
Luke.setName("Luke");
Luke.setAge(19);
Luke.setStudentNo(776);
// using the set methods
Ryan.setName ("Ryan") ;
Ryan.setAge (53) ;
Ryan.displayDetails () ;
System.out.println();
Luke.displayDetails();
}
}
[/codebox]