September 2005
Beginner
576 pages
13h 6m
English
To see an example of inheritance at work, you will create a class called Point3D that represents a point in three-dimensional space. A two-dimensional point can be expressed with an (x,y) coordinate. Applets use an (x,y) coordinate system to determine where text and graphics should be displayed. Three-dimensional space adds a third coordinate, which can be called z.
The Point3D class of objects should do three things:
Java already has a standard class that represents two-dimensional points; it's called Point. It has two integer variables called x
Read now
Unlock full access