cylindricalparcel.java

来自「Java程序设计(美) David D. Riley著 机械工业出版社 书籍配套」· Java 代码 · 共 26 行

JAVA
26
字号
// Figure 8.5public class CylindricalParcel  extends Parcel  {	private  double parcelRadius, parcelLength;	/** post:	parcelLength == len  AND  parcelRadius == r	 *			and volume == len*r*r*PI 	 *			and weight == volume*600 	 *			and isAirFreight==false */	public CylindricalParcel( double len, double r)   {		super( 0, 0, false );		parcelLength = len;		parcelRadius = r;		volume = parcelLength * Math.PI * Math.pow(parcelRadius,2);		weight = volume * 600;	}		public double length()  {		return parcelLength;	}		public double radius() {		return parcelRadius;	}}

⌨️ 快捷键说明

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