Results 1 to 3 of 3
Thread: Constructors
- 12-15-2011, 01:13 AM #1
Member
- Join Date
- Nov 2011
- Posts
- 12
- Rep Power
- 0
- 12-15-2011, 01:28 AM #2
- Join Date
- Jan 2011
- Location
- Richmond, Virginia
- Posts
- 3,069
- Blog Entries
- 3
- Rep Power
- 7
Re: Constructors
I'm confused by what you are asking, would you mind clarifying?
- 12-15-2011, 11:05 AM #3
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,385
- Blog Entries
- 7
- Rep Power
- 17
Re: Constructors
A constructor can call another constructor in the same class with the this( ... ) syntax; the ellipses represent the parameters for the other constructor; the 'this( ... )' call has to be the first statement of the constructor that wants to call another constructor. Alternatively a constructor can call a constructor witht the super( ... ) syntax, also as the first statement of the calling constructor. If a constructor does none of these, the compiler generates a 'super()' call statement in the calling constructor. If all constructors call another constructor in the same class (with the this( ... ) construct), the compiler will complain about it.
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
Similar Threads
-
constructors
By droidus in forum New To JavaReplies: 3Last Post: 04-28-2011, 08:14 PM -
Need help with constructors
By tpfaff in forum New To JavaReplies: 10Last Post: 10-22-2010, 04:33 AM -
Constructors
By suresh.sa in forum New To JavaReplies: 5Last Post: 10-20-2010, 12:10 AM -
Constructors?
By annna in forum New To JavaReplies: 3Last Post: 01-27-2010, 10:51 PM -
constructors
By khamuruddeen in forum New To JavaReplies: 2Last Post: 12-01-2007, 03:15 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks