File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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: 46349
  • 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 agree. Here's the link:
    subject: Constructors?
    jQuery in Action, 3rd edition