求java程序 输出一个圆的圆心是(3.4) 半径是5public class Circle{Point center;int radius;public Circle(Point center,int radius){this.center=center;this.radius=radius;}public int getCenter(){return this.center;}pubic int getRadius(){re
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/19 02:41:52
求java程序 输出一个圆的圆心是(3.4) 半径是5public class Circle{Point center;int radius;public Circle(Point center,int radius){this.center=center;this.radius=radius;}public int getCenter(){return this.center;}pubic int getRadius(){re
求java程序 输出一个圆的圆心是(3.4) 半径是5
public class Circle{
Point center;
int radius;
public Circle(Point center,int radius){
this.center=center;
this.radius=radius;
}
public int getCenter(){
return this.center;
}
pubic int getRadius(){
return this.radius;
}
public void setCenter(point center){
this.center=center;
}
public void setRadius(int radius){
this.radius=radius;
}
public void printInfo(){
System.out.println()
} 这是程序前半部分 后面要输出圆心是(3.4)半径是5
求java程序 输出一个圆的圆心是(3.4) 半径是5public class Circle{Point center;int radius;public Circle(Point center,int radius){this.center=center;this.radius=radius;}public int getCenter(){return this.center;}pubic int getRadius(){re
public void printInfo(){
System.out.println("圆心("+center.x+","+center.y+") 半径:"+radius);
}
public class Test{
public static void main(String[] args){
Circle circle=new Circle(new Point(3,4),5);
circle.printInfo();
}
}