April 25
Examples from April 25
Today we worked with one large example of Interfaces:
Point2D.java PointXY.java PointXYZ.java and Application.java File Point2D.java contains an interface for two dimensional points. We give two different implementations of this interface: PointXY.java and PointXYZ.java. The Application class makes use of these classes. In particular, it has a distance() method that takes arguments of type Point2D, regardless of which of the implementing classes these arguments come from.