Keith Rainey
OCPJP6
Russ Russell wrote:In the SCJP Study Guide it says: "You cannot make a call to an instance method, or access an instance variable, until after the super constructor runs."
It's as if the book is warning me against attempting to do something that's impossible to do anyway.
Keith Rainey
OCPJP6
Russ Russell wrote:By definition instance variables need an instance of the class to be accessed. How else would I access them unless the constructor has run (which means I made an instance)?
Joanne
Keith Rainey wrote:
Russ Russell wrote:In the SCJP Study Guide it says: "You cannot make a call to an instance method, or access an instance variable, until after the super constructor runs."
I interpreting that to mean you can't access instance members from within the constructor until the supers complete their run.
It's as if the book is warning me against attempting to do something that's impossible to do anyway.
If there's a way to do it, I can't think of it.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
SCJP
Visit my download page
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Rob Spoor wrote:the current object inside that Super constructor is still a Sub instance.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Everybody! Do the Funky Monkey! Like this tiny ad!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
|