are Rectangle Equal - Java 2D Graphics

Java examples for 2D Graphics:Rectangle

Description

are Rectangle Equal

Demo Code


//package com.java2s;

import java.awt.Rectangle;

public class Main {
    public static boolean areEqual(Rectangle a, Rectangle b) {
        if (a == null && b == null) {
            return true;
        } else if (a != null && b == null) {
            return false;
        } else if (a == null && b != null) {
            return false;
        } else {/* ww  w . j av a 2 s .c o m*/
            return a.equals(b);
        }
    }
}

Related Tutorials