File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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


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: 39053
    
  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.
  •  
    GeeCON Prague 2014
     
    subject: Constructors?