This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Constructors? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Constructors?" Watch "Constructors?" New topic


T sandya
Ranch Hand

Joined: Aug 03, 2006
Posts: 64
Hi Friends,
what are the similarities between constructor and method.
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 43993
  • 1: Both can have the same access modifiers.
  • 2: Both can have an argument list, in the same format.
  • 3: Both contain statements.
  • 4: Each can be mistaken for the other You can't call a contructor the way you call a method and you can't call a method the way you call a constructor.
    I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
    subject: Constructors?
    jQuery in Action, 3rd edition