This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what is the invisible statement in the constructor

 
Bhargavan Marepalli
Greenhorn
Posts: 15
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is the invisible statement in the constructor???
 
Rameshwar Soni
Ranch Hand
Posts: 247
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think a call to its base class constructor.....i.e. equivalent of using
 
Rob Spoor
Sheriff
Pie
Posts: 20495
54
Chrome Eclipse IDE Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no "invisible statement". There is indeed the implicit call to super() if the constructor doesn't start with a call to super(...) or this(...), but I've never heard that being called an "invisible statement".
 
Nam Ha
Ranch Hand
Posts: 50
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you call super() explicitly, it must be the first line in the constructor, otherwise the compiler will complain.
 
Bhargavan Marepalli
Greenhorn
Posts: 15
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you all...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic