Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2005

Tip: Looking for answers? Try searching our database.

I don't understand super()

Thread view: 
Boki - 21 Mar 2005 17:42 GMT
Hi, All,
           I don't understand super(),  it is a overdrive? SO I can use a
variable name that the same as class?

Best regards,
Boki.
klynn47@comcast.net - 21 Mar 2005 18:16 GMT
In the context super(), you would be calling a no argument constructor
of the superclass. This call would have to be the first exectuble line
in the subclass constructor.

Basically this use of super allows you to use the code from a
superclass constructor to initialize the variables inherited from the
superclass, and the rest of the subclass constructor can be used to
initialize the variables added in the subclass.
Thomas Kellerer - 21 Mar 2005 19:01 GMT
Boki wrote on 21.03.2005 17:42:
> Hi, All,
>             I don't understand super(),  it is a overdrive? SO I can use a
> variable name that the same as class?
>
> Best regards,
> Boki.

<http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#229267>
Hal Rosser - 21 Mar 2005 22:42 GMT
> Hi, All,
>             I don't understand super(),  it is a overdrive? SO I can use a
> variable name that the same as class?
>
> Best regards,
> Boki.

its just a call to the no-arg constructor of the parent class. It needs to
be the first line in the constructor of the derived class - if its used at
all. Don't worry - you'll get it sooner or later.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.