When you say public class Board< T extends Figure >
, it means that the Board can accept either Figure
or sub-interfaces of Figure
or any classes which implement these interfaces. So, when you say:
public class Cross implements Figure{}
and
Board b = new Board<Cross>();
This means that Cross has implemented Figure
, and thus Board
can accept Cross
, since Cross
IS-A Figure
As far as extending an interface is concerned, only interfaces can extend interfaces. So, the following is legal:
public interface TwoDimensionalFigure extends Figure{}.
So any class which implements TwoDimensionalFigure
can also be accepted by Board
.