Esperanto - Sistemo ne akceptas mian solvon
English - System does not accept my solution
package com.codegym.task.task13.task1302;
/*
Beer. Part 2. The recovery.
*/
public class Solution {
public static void main(String[] args) {
AlcoholicBeer beer = new AlcoholicBeer();
System.out.println(beer.toString());
}
public interface Drink {
boolean isAlcoholic();
}
public static class AlcoholicBeer implements Drink {
@Override
public String toString() {
if (isAlcoholic()) {
return "Alkoholos ital";
} else {
return "Nem alkoholos ital";
}
}
public boolean isAlcoholic(){
return true;
}
}
// 1. The AlcoholicBeer class must implement the Drink interface.
//2. The AlcoholicBeer class must implement all of the Drink interface's methods.
//3. There must be only two methods in the AlcoholicBeer class.
//4. The isAlcoholic method must return true, since beer contains alcohol.
//5. Depending on what the isAlcoholic method returns, the program must display the corresponding
// drink type on the screen.
}