You can only do this with an abstract class, not with an interface.
Declare Rectangle
as an abstract class
instead of an interface
and declare the methods that must be implemented by the sub-class as public abstract
. Then class Tile
extends class Rectangle
and must implement the abstract methods from Rectangle
.