• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Application Related

 
tejas jadhav
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does any body know what Constructor returns?
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
tejas,
A constructor for any class returns an instance (actual object) of the class in which it is defined in... Normally you have to define a return type, but the constructor is a special case and it's return type is always the type of object defined in your class... and the only way to call a constructor is via the new keyword. (illustration only... not actual code... the code in angle brackets would not actually be in a real program.) -

HTH,
-Nate
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic