我不知道如何完成这个。我自己学习,我发现了这个练习,你有一个这样的矩形类:
public class Rectangulo {
private int x, y, width, heigth;
public Rectangulo(int x, int y, int width, int heigth){
this.x = x;
this.y = y;
this.width = width;
this.heigth = heigth;
}
public boolean isOverlaping(Rectangulo r1, Rectangulo r2){
}
而且我必须完成该方法,因此如果 2 个矩形重叠/碰撞,则返回 true,否则返回 false。你能给我任何指导来帮助我思考这个问题,或者提示吗?
我不必使用 intersects 方法。
谢谢!