In Java, inheritance lets you take one blueprint and extend it to more complicated blueprints.
For example, here the Position class is extended to have three dimensions:
public class Position3D extends Position {
public int z;
public Position3D (int x, int y, int z) {
this.x = x;
this.y = y;
this.z = z;
}
public int getDimensonality () {
return 3;
}
}