Please dont tell me to "google" it obviously I'v tried everything and this is my last resort. k thanks :)
ok so I have to set a value to be restricted in the constructor
___________
Modify the constructor and set methods of the Shape class to verify the values of X and Y stay between zero and the MAX size. If X or Y are out of range, issue an error message on the console and set the value to zero.
___________
I don't remember how to do this nor can i find it online
import java.util.Scanner;
public abstract class Shape {
int x;
int y;
//--------------------------------------------phase2 add in
protected final static int X_MAX_SIZE = 800;
protected final static int Y_MAX_SIZE = 600;
//--------------------------------------------
int getX(){
return x;
}
void setY(int l_ycoord){
y = l_ycoord;
}
//--------------------------------------------
void setX(int l_xcoord){
x = l_xcoord;
}
int getY(){
return y;
}
//--------------------------------------------
public Shape (){
}
public void Shape(int l_xcoord, int l_ycoord){
x = l_xcoord;
y = l_ycoord;
}
//--------------------------------------------
abstract void display();
abstract double area();
//--------------------------------------------
public static void main(String[] args) {
}
}