<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">/** An instance is a coordinate in three dimensions */
public class ThreeDimPoint {
    
    // This instance represents the point (x, y, z)
    private int x;
    private int y;
    private int z;
    
    /** Constructor: an instance with coordinates (a,b,c) */
    public ThreeDimPoint(int a, int b, int c) {
        a= x;
        b= y;
        c= z;
    }
    
    // Getter methods
    /** = the x-coordinate of this point */
    public int getX() { 
        return x;
    }
    
    /** = the y-coordinate of this point */
    public int getY() {
        return y;
    }
    
    /** = the z-coordinate of this point */
    public int getZ() {
        return y;
    }
 
    /** = "at least one of the coordinates of this point is 0" */
    public boolean hasAZero() {
        return x == 0  &amp;&amp;  y == 0  &amp;&amp;  z == 0;
    }
    
    /** = length of line from (0,0,0) to this point. */
    public double length() {
        return Math.sqrt(x*x + y*y + z*z);
    }
    
    /** = length of line from (0,0,0) to point c. */
    public double length1(ThreeDimPoint c) {
        return Math.sqrt(c.x*c.x + c.y*c.y + c.z*c.z);
    }
    
}</pre></body></html>