Java Interfaces and UML

Implement the following class hierarchy on paper. You do not need to fill in the method bodies for the toss or bounce methods.

Solutions:

public interface Tossable
{
    void toss();
}
public abstract class Ball implements Tossable
{
    private String brandName;
    
    public Ball(String brandName)
    {
        this.brandName = brandName;
    }
    
    public String getBrandName()
    {
        return brandName;
    }
    
    public abstract void bounce(); 
}
public class Baseball extends Ball
{

    public Baseball(String brandName)
    {
        super(brandName);
    }

    public void toss()
    {
    }

    public void bounce()
    {
    }

}
public class Football extends Ball
{

    public Football(String brandName)
    {      
        super(brandName);
    }
    
    public void toss()
    {
    }

    public void bounce()
    {
    }
}
public class Rock implements Tossable
{
    
    public void toss()
    {        
    }
    
}

Answer the following questions: