dcsimg
Private Access for methods of SubClass
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   santosh_jogade
Posted On:   Thursday, June 26, 2003 11:25 PM

A child class can override a method of a Parent Class But Can the method be declared as Private in Child Class? What happens if I declare that method as Private in Child Class

Re: Private Access for methods of SubClass

Posted By:   David_Bates  
Posted On:   Friday, June 27, 2003 12:33 AM

The visibility of a method cannot be reduced in a subclass, it may only be increased. This means the following are allowed:

  • private -> default, protected, public

  • default -> protected, public

  • protected -> public

About | Sitemap | Contact