I've heard it takes forever to grow a woman from the ground
Mike Gershman
SCJP 1.4, SCWCD in process
Originally posted by Mike Gershman:
In my view, constructors are misnamed - they alter already initialized variables in already created objects,
I've heard it takes forever to grow a woman from the ground
try and run a method on either before a constructer, and brace your self for a fat NullPointerException
Mike Gershman
SCJP 1.4, SCWCD in process
I've heard it takes forever to grow a woman from the ground
(1) "memory space is allocated for the object with room for all the instance variables declared in the class type and all the instance variables declared in each superclass of the class type," (2) the constructor is run, which means (2a) run the super() constructor (if super is used) (2b) execute instance variable initializers, and (2c) execute the body of the constructor.
Running a method on an unconstructed object? I certainly do doubt that that will pass.
You cannot make a call to an instance method, or access an instance variable, until after the super constructor runs.
Mike Gershman
SCJP 1.4, SCWCD in process
Originally posted by Joseph George:
Try what? Running a method on an unconstructed object? I certainly do doubt that that will pass.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Originally posted by Mike Gershman:
..BTW, constructors are not methods. Unlike methods, constructors can alter final variables.
Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
I guess I've been abducted by space aliens. So unprofessional. They tried to probe me with this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
|