• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Constructors?

 
T sandya
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,
what are the similarities between constructor and method.
 
Campbell Ritchie
Sheriff
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
  • 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.
  •  
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic