aspose file tools*
The moose likes Beginning Java and the fly likes what is the invisible statement in the constructor Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "what is the invisible statement in the constructor" Watch "what is the invisible statement in the constructor" New topic
Author

what is the invisible statement in the constructor

Bhargavan Marepalli
Greenhorn

Joined: Jun 25, 2011
Posts: 15

what is the invisible statement in the constructor???
Rameshwar Soni
Ranch Hand

Joined: Feb 03, 2011
Posts: 247
I think a call to its base class constructor.....i.e. equivalent of using
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19760
    
  20

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".


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Nam Ha
Ranch Hand

Joined: Aug 05, 2011
Posts: 50

If you call super() explicitly, it must be the first line in the constructor, otherwise the compiler will complain.


Java Object Creation
Bhargavan Marepalli
Greenhorn

Joined: Jun 25, 2011
Posts: 15

thank you all...
 
 
subject: what is the invisible statement in the constructor