Create an interface named as “TeaService” having following method abstract methods Boling Tea Serving Tea Is Tea Hot Create another interface named as “BiscuitService” having following method abstract methods Bake Biscuit Serving Biscuit Is Biscuit Baked Create another interface named as “TeaParty” having only one default method but inherit both interfaces: “TeaService” and “BiscuitService”. Default method name is “partyStarted” and displays “Party is started”. Create a class named “SchoolTeaParty” having two boolean attributes: bakedBiscuit and hotTea. Complete the class such that for the following main method it produces output as show below. Main Class with main method public class Main { public static void main(String[] args) { SchoolTeaParty schoolTeaParty = new SchoolTeaParty(); schoolTeaParty.serveBiscuit(); schoolTeaParty.servingTea(); schoolTeaParty.bakeBiscuit(); schoolTeaParty.boilingTea(); schoolTeaParty.serveBiscuit(); schoolTeaParty.servingTea(); schoolTeaParty.partyStarted(); } } Output of the main method We are waiting for baking biscuit We are waiting for Tea to boil We are baking biscuit We are boiling the Tea We are serving biscuit We are Serving Tea Party is started
Create an interface named as “TeaService” having following method abstract methods
- Boling Tea
- Serving Tea
- Is Tea Hot
Create another interface named as “BiscuitService” having following method abstract methods
- Bake Biscuit
- Serving Biscuit
- Is Biscuit Baked
Create another interface named as “TeaParty” having only one default method but inherit both interfaces: “TeaService” and “BiscuitService”. Default method name is “partyStarted” and displays “Party is started”.
Create a class named “SchoolTeaParty” having two boolean attributes: bakedBiscuit and hotTea. Complete the class such that for the following main method it produces output as show below.
Main Class with main method
public class Main {
public static void main(String[] args) {
SchoolTeaParty schoolTeaParty = new SchoolTeaParty();
schoolTeaParty.serveBiscuit();
schoolTeaParty.servingTea();
schoolTeaParty.bakeBiscuit();
schoolTeaParty.boilingTea();
schoolTeaParty.serveBiscuit();
schoolTeaParty.servingTea();
schoolTeaParty.partyStarted();
}
}
Output of the main method
We are waiting for baking biscuit
We are waiting for Tea to boil
We are baking biscuit
We are boiling the Tea
We are serving biscuit
We are Serving Tea
Party is started
Step by step
Solved in 4 steps with 2 images