1-super calls the parent constructor 2-you have the same names for the incomming parameters so you need 'this' to make sure the objects data gets set
On Feb 23, 2:26 am, "Jon Carlson" <[email protected]> wrote: > Hi all, I just had a question about the use of the "super" keyword in the > lab as used below: > > public TV(double regularPrice, > > String manufacturer, > > int size) { > > super(regularPrice, manufacturer); > > this.size = size; > > } > > I was wondering if someone could explain how the "super" and "this" lines of > code is being applied and what their purpose is. I understand generally > what it is they are doing, but it is slightly confusing. Thanks ahead of > time. > > Jon Carlson P.E. > > Engineering Director > > CC Technics, Inc. > > 253-250-1600 cell > > 253-473-9295 office > > 253-476-2712 fax > > <mailto:[email protected]> [email protected] > > <http://www.cctechnics.com>www.cctechnics.com > > DISCLAIMER: > > This message is confidential, intended only for the named recipient(s) and > may contain information that is privileged or exempt from disclosure under > applicable law. If you are not the intended recipient(s), you are notified > that the dissemination, distribution or copying of this information is > strictly prohibited. If you received this message in error, please notify > the sender then delete this message. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
