2 Replies Latest reply: Nov 17, 2009 11:28 AM by 764604 RSS

    Inheritance Constructor error

    764604
      Hi guys, having a spot of bother with a constructor of a sub-class.
      What i am doing is making a super class... Person and a subclass... Administrator
      When i am coding my constructor for the administrator every inherited field constructs but my local one does not

      The error i get is on the constructor parameter, Cannot find symbol : constructor Person. class: Person
      I think it may be something to do with java not knowing what constructor to use

      Heres my code
      Person
      public abstract class Person{
          // TO DO
          // READ THE COMMENTS AND COMPLETE
      
          //Attributes
         public String name;
         public String address; 
         public String sex;
         public int age;
      
             public Person(String name, String address, String sex, int age) {
              this.name = name;
              this.address = address;
              this.sex = sex;
              this.age = age;
          }
      Administrator
      public class Administrator extends Person {
          // Attributes
          private String type;
          // TO DO
          // READ THE COMMENTS AND COMPLETE
      
          /**
           * Constructor
           * @param name name of the administrator
           * @param address address of the administrator
           * @param gender sex of the administrator
           * @param age age of the administrator
           * @param type member type of the administrator
           */
      
          public Administrator(String name, String address, String gender,
                  int age, String type) {
              
              this.name=name;
              this.address=address;
              this.sex= gender;
              this.age=age;
              this.type=type;
              
          }