This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach 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

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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: 37884
  • 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?
    Similar Threads
    another question on constructors
    WA #1.....word association
    Constructor doubt - K&B Book
    Constructors are not inhertied - True