Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Java
calling the constructor of a class from within the class in java
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Patricia Shanahan, post: 2010240"] Building a new object is the inherent function of a Java constructor. What are you really trying to do? If you are just trying to save object creation by reuse, I would advise against it, and recommend creating a new object instead. If you need to reset some, but not all, fields, so that a new object won't work, put the reset work in a separate method. You can call it from the constructor, to avoid duplicate code. Patricia [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Java
calling the constructor of a class from within the class in java
Top