aspose file tools*
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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Constructors?" Watch "Constructors?" New topic
Author

Constructors?

T sandya
Ranch Hand

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

Joined: Oct 13, 2005
Posts: 38392
    
  23
  • 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.
  •  
    It is sorta covered in the JavaRanch Style Guide.
     
    subject: Constructors?