Does Wine object has access to taste method in abstract class Drink? like it shows in the program. Is it because it extends it?
i just finished the task but i've a question
Archived
Comments (1)
- Popular
- New
- Old
You must be signed in to leave a comment
Thomas
5 June 2021, 08:22
Yes, if you access the Wine object with a Wine reference variable you can call all public or protected or methods defined in Wine and Drink (package private methods may work also, depending on your implementation but private methods never can get inherited). If you access the Wine object with a Drink reference variable you just can invoke the methods that Drink knows about, so all Drink and Object methods.
0