⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 circle.java

📁 第四次作业 1、 创建一个Animal(动物)类
💻 JAVA
字号:

public class Circle extends GraphicObject {
	/**
	 * specific attributes Circle has
	 * center and radius
	 */
	private Point center;
	private double radius;
	
	/**
	 * constructor that inherits from base class GraphicObject
	 * and initial the attributes added
	 */
	Circle(){
		super();
		center = new Point(0,0);
		radius = 1;
	}
	
	Circle(String lineColor,String fillColor,Point center,double radius){
		super(lineColor,fillColor);
		this.center = center;
		this.radius = radius;
	}
	
	

	@Override
	public void draw() {
		// TODO Auto-generated method stub
		System.out.println("Draw the center of the Circle is x = " + center.getX()+"y = "+center.getY()
				+"color of the line is "+super.getColorOfLine()+"fillcolor is "+super.getFillcolor());

	}

	@Override
	public void rotate() {
		// TODO Auto-generated method stub
		System.out.println("rotate this circle");
		draw();

	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -