|
First I think Cat should never derived from Dog, as just in a real world Cat and Dog are different species. You could create an Animal class which then can be derived by both Cat and Dog.
If you correctly define your method you should not have to do method hiding this way. In Java the access modifier such as public, protected, the default and private can be choose whether the method or field can be inherited to the child class.
__________________
Website: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. - Blog: To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|