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 =0, y =0
}
public Point(int x1, int y1){
}
public void print(){
}
System.out.print("("+ x +","+ y +")");
public String toString(){
return x +""+ y +"";
}
public void setPoint(int x1, int y1){
}
public int getPointX(){
}
public int getPointY(){
}
}
public class ThreeDPoint \square {
private int z;
//x =0, y =0, z =0
public ThreeDPoint (){
}
//x = x1, y = y1, z = z1
public ThreeDPoint (int x1, int y1, int z1){
}
//output x, y, z
public void print(){
}
public String toString(){
}
//x = x1, y = y1, z = z1
public void setThreeDPoint (int x1, int y1, int z1){
\square
}
Write the missing code in the following class

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!