package three;
public class Point {
double x;
double y;
public class Point {
double x;
double y;
}
package three;
public class Circle {
Point a = new Point();
double radius;
Circle(){
a.x = 5.0;
a.y = 5.0;
radius = 3.0;
}
Circle(double x,double y,double r){
a.x = x;
a.y = y;
radius = r;
}
void test(Circle c){
if(a.x == c.a.x && a.y == c.a.y && radius == c.radius){
System.out.println("该圆与c1重合");
}
else
System.out.println("该圆与c1不重合");
}
}
package three;
public class TestCircle {
public static void main(String[] args) {
Circle c1 = new Circle();
Circle c2 = new Circle(5.0,5.0,3.0);
Circle c3 = new Circle(3.0,5.0,3.0);
c1.test(c2);
}
}