Question: Implement polymorphism in your program by creating an array of Tea objects that includes instances of the Tea class and its subclasses. Create three subclasses
Implement polymorphism in your program by creating an array of Tea objects that
includes instances of the Tea class and its subclasses.
Create three subclasses of the Tea class: BlackTea, GreenTea, and HerbalTea. Each
subclass should override the prepareTea method to prepare the specific type of tea
black tea, green tea, or herbal tea with appropriate ingredients and brewing times.
Create a Tea class in Java that includes the following methods:
aprepareTea a method that prepares a basic tea with hot water and tea leaves.
baddMilk a method that adds milk to the basic tea.
caddSugar a method that adds sugar to the basic tea.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
