Click the Exhibit button. Which, inserted at line 3 of the TestDrink class, demonstrates the “program to an interface” principle?
A. Drinkable aDrink = DrinkableFactory.getDrinkable();
B. Drinkable aDrink = new Drinkable();
C. Tea aDrink = new Drinkable();
D. Tea aDrink = new Tea();
Answer:A
Click the Exhibit button. Which, inserted at line 3 of the TestDrink class, demonstrates the “program to an interface” principle?
A. Drinkable aDrink = DrinkableFactory.getDrinkable(); B. Drinkable aDrink = new Drinkable(); C. Tea aDrink = new Drinkable(); D. Tea aDrink = new Tea();