Difference between constructors and methods

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • anurag275125
    New Member
    • Aug 2009
    • 79

    Difference between constructors and methods

    Can anyone please explain me the difference between constructors and methods in java??
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    Originally posted by anurag275125
    Can anyone please explain me the difference between constructors and methods in java??
    A constructor fills in the details (i.e. the 'state') of a newly created object; methods of an object make the object do something. Have you read Sun's Java Tutorial? Read the links in the very first article in this forum section.

    kind regards,

    Jos

    Comment

    Working...