Question: in java please thank u 1) why is there an error at line 3 ? public class Point{ protected int x, y; public Point(int x,
in java please thank u
1) why is there an error at line 3 ?
public class Point{
protected int x, y;
public Point(int x, int y ) {
this.x = x; this.y = y ;
}
public String show () {
return "{" + x+" , "+y+"}";
}
}
For the code below
2)First Rewrite Point 3D constructors to assign all three feilds their first values via parameters
3) Then write a code to override the show() method for the Point3D class so that all three feilds are included.
public class Point3D extends Point {
protected int j;
public Point3D(int x, int y, int j){
this.x = x ; this.y = y ; this.j = j ;
}
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
