I can't understand why I'm getting an error on the line indicated below. if there is a specific topic which covers it please provide a line (or an explanation).
public interface Button {
void press();
}
public class Bomb implements Button {
public void press() {
System.out.println("Doesn't work");
}
void boom() {
System.out.println("Exploded");
}
}
public class Test {
public static void main(String[] args) {
Button redButton = new Bomb();
redButton.press();
redButton.boom(); // <-- Error is on this line.
}
}