0

I'm doing some beginning javaing and I been getting this error method for

public CommissionEmployee(String firstName, String lastName, String SocialSecurityNumber, double GrossSales, double commissionRate) {
//implicit call to Object constructor occurs here
this.firstName = firstName;
this.lastName = lastName; 
this.SocialSecurityNumber = SocialSecurityNumber;
setGrossSales(7500.0); //validate and store gross Sales
setCommissionRate(.05); //Validate and Store Commission Rate
}

Can someone please explain my error? I do not want to ignore this since I cannot extend the code into a subclass.

  • 3
    Include the actual stack trace and error message. – Cory Kendall Mar 18 '13 at 01:46
  • also note that the tipical Java convensions are: variables starts with lowercase, clases with uppercase and primitives with a lowercase. In line #5 you are assigning what looks like a class to an attribute. Is that OK? – lemil77 Mar 18 '13 at 01:48
  • 3
    "Overridable method call in constructor" is a warning, and why it is important is explained in this question: http://stackoverflow.com/questions/3404301/whats-wrong-with-overridable-method-calls-in-constructors – Cyrille Ka Mar 18 '13 at 01:50
  • It's unusual that you'd use the method setters in the object instead of assigning through to the fields instead, as in the above three examples. – Makoto Mar 18 '13 at 01:50

0 Answers0