i have class point:
public class Point
{
private double _x;
private double _y;
}
also i have getX(), getY() methods.
i need to define 2 methods:
1. public boolean isAbove(Point other)
2. public boolean isUnder(Point other)
So this is what I have come up with:
public boolean isAbove(Point other)
{
if (this._y <= other._y)
{
return false;
}
else
{
return true;
}
}
public boolean isUnder(Point other)
{
}
I have tried several things on isUnder and get different results. What is the correct way to write those 2 methods ?
** important **
I have to use isAbove() method on isUnder() !!
isUndercan be implemented like thisand
isAbovecan be