Hi
can u call an Instance method from the constructor in java. thanks for your help.
codered152
0
Light Poster
Recommended Answers
Jump to PostYes.
Jump to PostYes.
I feel I need to qualify this remark.
That method should be final, because if someone extends your class, you will probably wind up with unexpected (and quite probably, for your class, catastrophic) effects if the method called from the constructor is overridden, as the overridden method would …
All 5 Replies
Ezzaral
2,714
Posting Sage
Team Colleague
Featured Poster
VernonDozier
commented:
Couldn't have said it better myself. :)
+6
edensigauke
-8
Light Poster
masijade
1,351
Industrious Poster
Team Colleague
Featured Poster
stephen84s
commented:
Great Info ... I have used it dozens of times never aware of this danger !!!
+2
darkagn
315
Veteran Poster
Featured Poster
codered152
0
Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.