jQuery in Action, 3rd edition
The moose likes Beginning Java and the fly likes constructors & methods Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "constructors & methods" Watch "constructors & methods" New topic

constructors & methods

James .D.Johnstone

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

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...


"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
James .D.Johnstone

Joined: Dec 08, 2004
Posts: 20
Thanks Marc that has cleared the cobwebs out of the old stetson !
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: constructors & methods
It's not a secret anymore!