| Previous | Next | Table of Contents |
| Diagram of the bicycle inheritance.
Lifted from The Java Tutorial (Sun Microsystems). |
class Point3D extends Point {
double z;
Point3D (double x, double y, double z) {
this.x = x;
this.y = y:
this.z = z;
}
public double length() {
return Math.sqrt(x*x + y*y + z*z);
}
...
}
|
| Previous | Next | Table of Contents |