I have to get the subclass to use the superclass constructor, heres my code:
[CODE=java]public class Student
{
// instance variables
private String name;
private int pin;
private boolean newToOU;
private Map<String, List<Integer>> courses;his id the super class
public Student(String aName)
{
super();
Student.counter ++;
this.name = aName;
this.pin = Student.counter ;
this.newToOU = true;
this.courses = new HashMap<String, List<Integer>>( );
this is the subclass
public class StudentAdmin extends Student
{
/* instance variables */
private Map<Integer, String> allStudents;
private Set<Integer> continuingStude nt;
private Set<Integer> newStudent;
public StudentAdmin()
{
super();
this.allStudent s = new TreeMap<Integer , String>();
this.continuing Student = new TreeSet<Integer >();
this.newStudent = new TreeSet<Integer >();[/CODE]
when I compile this code I get an error: cannot find symbol - constructor Student()
Any help would be gratefully accepted
[CODE=java]public class Student
{
// instance variables
private String name;
private int pin;
private boolean newToOU;
private Map<String, List<Integer>> courses;his id the super class
public Student(String aName)
{
super();
Student.counter ++;
this.name = aName;
this.pin = Student.counter ;
this.newToOU = true;
this.courses = new HashMap<String, List<Integer>>( );
this is the subclass
public class StudentAdmin extends Student
{
/* instance variables */
private Map<Integer, String> allStudents;
private Set<Integer> continuingStude nt;
private Set<Integer> newStudent;
public StudentAdmin()
{
super();
this.allStudent s = new TreeMap<Integer , String>();
this.continuing Student = new TreeSet<Integer >();
this.newStudent = new TreeSet<Integer >();[/CODE]
when I compile this code I get an error: cannot find symbol - constructor Student()
Any help would be gratefully accepted
Comment