aspose file tools*
The moose likes Associate Certification (OCAJP 7/8) and the fly likes Verification of constructor calling Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Associate Certification (OCAJP 7/8)
Bookmark "Verification of constructor calling" Watch "Verification of constructor calling" New topic
Author

Verification of constructor calling

Glenn Gould
Greenhorn

Joined: Jul 09, 2013
Posts: 5
Verification of constructor calling
1) From within the same class
When you are within the same class, one constructor can call another constructor using the "this" keyword


2) Within a class hierarchy
When there is an inheritance hierarchy, the constructor of the subclass can call the constructor of the superclass using the "super" keyword


Please confirm.
Mala Gupta
Author
Ranch Hand

Joined: Sep 27, 2002
Posts: 251
    
    9
Glenn,

Verification of constructor calling
1) From within the same class
When you are within the same class, one constructor can call another constructor using the "this" keyword

2) Within a class hierarchy
When there is an inheritance hierarchy, the constructor of the subclass can call the constructor of the superclass using the "super" keyword
Please confirm.



Both of your statements are correct - as already confirmed by the code output.

With respect,
Mala




Author of Manning's OCA Java SE 7 Programmer I Certification Guide and OCP Java SE 7 Programmer II Certification Guide
 
Don't get me started about those stupid light bulbs.
 
subject: Verification of constructor calling