On Jun 5, 12:00 pm, [email protected] wrote: > Thanks for the response. > I'll assume that this is an error in the lab exercise that we (the students) > have to correct. I am not sure what is the intent, probably just typos. Works fine after suggested modification. I modify as such: public PersonAnother2(int savings, int retirementFund, String firstname, String lastname){ super(savings, retirementFund, firstname, lastname); } > Jun 4, 2009 09:49:13 AM,[email protected]: > On Jun 4, 11:40 am,[email protected]: > > Hi All, > > I followed the lab exercise for Rewriting Interface under the topic Java > > Interface and Abstract class of Java Programming with Passion. > > In step 6 I got an error in PersonAnother2() that says "cannot find symbol > > constructor Person()" is this coded this way on purpose ? Or is this really > > a syntax error? > > Any help/comments will be appreciated. > > Thanks. > > THESE ARE THE CODES: > > package mypersoninterfaceproject; > > public class PersonAnother2 extends Person implements > > PersonInterfaceAnother{ > > > > PersonAnother2(){ > > > > } > Probably, parent does not have an empty constructor. One way to go is > to provide parameters to child's constructor. For example: > PersonAnother2(){ > super(); > } > > > > // Implement a new method > > public void newMethod(){ > > // Some code > > } > > }
--~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/javaprogrammingwithpassion?hl=en -~----------~----~----~----~------~----~------~--~---
