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

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 Databases Questions!