Inheritancesubclass “is-a” superclass
public class Point3D extends Point2D {
public int zloc ;
public Point3D() { zloc = 0 ; }
// other methods
}
. . .
Point3D my_p1 = new Point3D();
my_p1.zloc = 10;
my_p1.xloc = 3 ;
Previous slide
Next slide
Back to first slide
View graphic version