I m new in Java and I have a simple problem:
I have the following class Point:
public class Point {
private int yAxis;
private int xAxis;
public Point (int x, int y)
{
xAxis = x;
yAxis = y;
}
}
I created a new class that extends class Point. I want my new class to take as arguments two objects Point. I wrote the following code but I receive the error "Implicit super constructor MyPoint() is undefined. Must explicitly invoke another constructor". How can I fix the problem?
Thanks in advance!
public class Rectangle extends Point {
private int length1;
private int height1;
public Rectangle(int x, int y, int l, int h) {
super(x, y);
l = length1;
h = height1;
}
public Rectangle(Point topLeft, Point bottonRight) {
}
}