الرجوع
تسجيل الدخول

Given the following Java code snippet:

public class Circle {
    private double radius;

    public Circle(double r) {
        radius = r;
    }

    public boolean equals(Circle c) {
        return this.radius == c.radius;
    }

    public static void main(String[] args) {
        Circle c1 = new Circle(10.0);
        Circle c2 = new Circle(10.0);
        System.out.println(c1.equals(c2));
    }
}