SE450
:
Defining a New Interface Type
[38/41]
Name the methods to conform to standard library
public interface MoveableShape
{
void draw(Graphics2D g2);
void translate(int dx, int dy);
}
CarShape
class implements
MoveableShape
public class CarShape implements MoveableShape
{
public void translate(int dx, int dy)
{ x += dx; y += dy; }
. . .
}