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:
a)prepareTea()- a method that prepares a basic tea with hot water and tea leaves.
b)addMilk()- a method that adds milk to the basic tea.
c)addSugar()- a method that adds sugar to the basic tea.
 Implement polymorphism in your program by creating an array of Tea

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!