This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes using superclass constructor Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "using superclass constructor" Watch "using superclass constructor" New topic

using superclass constructor

nirjari patel
Ranch Hand

Joined: Apr 23, 2009
Posts: 368

My question is, if I want to call super constructor outside of GraphicalDice constructor, can I do that ?

Tom Reilly

Joined: Jun 01, 2010
Posts: 618
A constructor can only be called from another constructor. And a further restriction is a constructor can only be called from the first line of another constructor.
Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

Why would you like to invoke the super constructor from another location?

"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
I agree. Here's the link:
subject: using superclass constructor
Similar Threads
Must subclass call constructor of super class
SCJP certification
Question regarding Inheritance
this() and super()