extrovertive Posted December 29, 2008 Share Posted December 29, 2008 I know a final method (i.e. final public function foo(){}) prevents a child class from overriding that method. But can a private method be override in a child class? If so, what's difference does it make between a protected method? What's the difference between making a method final and a method private? Examples? Quote Link to comment Share on other sites More sharing options...
Mchl Posted December 29, 2008 Share Posted December 29, 2008 private method can not be called from child classes, final can (as long as it is protected or public) In other words: public, protected, private - tell who can call the method final - tells that method can not be overriden Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.