aspose file tools
The moose likes Beginning Java and the fly likes constructors & methods Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "constructors & methods" Watch "constructors & methods" New topic
Author

constructors & methods

James .D.Johnstone
Greenhorn

Joined: Dec 08, 2004
Posts: 20
I wonder if someone could help me master the concept of using the constructors and methods within a class . ie when a constuctor should be used and when a method should be used within a class


thankyou for your input in advance
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Basically, constructers perform tasks necessary to instantite (create an instance of) an object. In other words, constructors -- which are tecnhically neither methods nor members -- get an object ready to do whatever it's supposed to do.

You may want to read Bruce Eckel's "Initialization and Cleanup" chapter from Thinking in Java...

http://www.faqs.org/docs/think_java/TIJ306.htm


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
James .D.Johnstone
Greenhorn

Joined: Dec 08, 2004
Posts: 20
Thanks Marc that has cleared the cobwebs out of the old stetson !
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: constructors & methods
 
Similar Threads
Cloning in java
public private constructor
constructor calling this() and super() problem
constructor concepts...
What does "pass object to constuctor" mean?