EX 7.15 Imagine a game in which some game elements can be broken by the player and others can’t. Create an interface called Breakable that has a method called break that takes no parameters and another called broken that returns a boolean result indicating whether that object is currently broken.

Respuesta :

Answer:

public interface Breakable

{

  public void break();  

public boolean broken();

}

Explanation:

Here is the interface named Breakable

This interface has two functions break() and broken()

break() method has no parameters

broken() method returns a boolean result. As you can see boolean keyword is written before the method name  which basically return true or false.