Java Reference
In-Depth Information
evolve the Java API. Let's look at an example in detail to see the consequences of modifying an
interface that's already been published.
9.1.1. API version 1
The first version of your Resizable interface has the following methods:
public interface Resizable extends Drawable{
int getWidth();
int getHeight();
void setWidth(int width);
void setHeight(int height);
void setAbsoluteSize(int width, int height);
}
User implementation
One of your most loyal users decides to create his own implementation of Resizable called
Ellipse:
public class Ellipse implements Resizable {
...
}
He's created a game that processes different types of Resizable shapes (including his own
Ellipse):
 
Search WWH ::




Custom Search