Hi, have a look at the foll. code
package points;
public class Point {
int x, y;
public void move(int dx, int dy) { x += dx; y += dy; }//1
}
package points;
public class Point3d extends Point {
int z;
public void move(int dx, int dy, int dz) {
x += dx; y += dy; z += dz;
}
}
and a third compilation
unit, in another package, is:
import points.Point3d;
class Point4d extends Point3d {
int w;
public void move(int dx, int dy, int dz, int dw) {
super.move(dx, dy, dz); w += dw;}}}
My doubt is at line 1 if public is replaced with default
then i get an error when compiling point 4d.Please explain
why is it so?
Thanks!