Question: Write the missing code in the following class definitions. Then implement a test class to test your code. Note: ThreeDPoint should inherits Point class. Also,
Write the missing code in the following class definitions. Then implement a test class to
test your code.
Note: ThreeDPoint should inherits Point class. Also, methods of ThreeDPoint should
reuse Point class's methods.
public class Point
private int x;
private int y;
public Point
x y
public Pointint x int y
public void print
System.out.print x y ;
public String toString
return x y ;
public void setPointint x int y
public int getPointX
public int getPointY
public class ThreeDPoint square
private int z;
x y z
public ThreeDPoint
x x y y z z
public ThreeDPoint int x int y int z
output x y z
public void print
public String toString
x x y y z z
public void setThreeDPoint int x int y int z
square
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
