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

📄 oval.java

📁 这是一种用JAVA开发的图形画法程序 没有错误 欢迎各位朋友改进并上传
💻 JAVA
字号:
/**
 * Title: Oval.java
 * Description: Classes that define an Oval  
 * It should be subclasses of GeometricShape and include the implementation of two methods
 * named calculateArea and calculatePerimeter.
 * 
 * Copyright: Copyright (c) 2006
 * @author Q Jin
 * @version 1.0
 */

public class Oval extends GeometricShape{
	
	// this is a default oval method
	public Oval(){
		this(0,0);
	}
	
	// this is a oval method with two parameters
	public Oval( int x, int y ){
		this.x = x;
		this.y = y;
	}
	
	/**
	 * This is calculateArea method
	 * 
	 * @return Math.PI * x * x / 4    this is area of shapes
	 */ 
	public double calculateArea(){
		return Math.PI * x * x / 4;
	}
	
	/**
	 * This is a calculatePerimeter method
	 * 
	 * @return Math.PI * x  this is perimeter of shapes
	 */
	public double calculatePerimeter(){
		return Math.PI * x;
	}
	
}

⌨️ 快捷键说明

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