I changed the return type of the method: public static SparklingWine getSparklingWine() to SparklingWine instead of Wine. But neither works..
so I don't understand what to do different?
package com.codegym.task.task14.task1410;
/*
Wine tasting
*/
public class Solution {
public static void main(String[] args) {
getDeliciousDrink().taste();
System.out.println(getWine().getCelebrationName());
System.out.println(getSparklingWine().getCelebrationName());
System.out.println(getWine().getCelebrationName());
}
public static Drink getDeliciousDrink() {
return new Wine();
}
public static Wine getWine() {
return new Wine();
}
public static SparklingWine getSparklingWine() {
return new SparklingWine();
}
}