• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

constructors & methods

 
Daniel Hyslop
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Daniel Hyslop
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Marc that has cleared the cobwebs out of the old stetson !
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic