Monday, April 26, 2010

If we throw Derived object will it catch by base or derived ? see code and Answer


Output :
base cought

NEXT Question comes in Mind is  : 
What if inheritance is of PRIVATE or PROTECTED
Ans: in that case object will be cought at Derived catch block only.

Remember : Only Public inheritance is " IS-A "relation ., can be treated as BASE TYPE  

2 comments:

Followers