📄 driver.java
字号:
/** Parcels Program (Figures 8.2, 8.4, & 8.5) * Author: David Riley * Date: January, 2005 */public class Driver { public Driver() { Parcel someParcel; RectangularParcel box; CylindricalParcel cylinder; someParcel = new Parcel( 0.56, 0.3, true ); System.out.println( "Cost to ship: " + someParcel.shippingCost() ); box = new RectangularParcel( 1.1, 0.5, 0.3, false ); System.out.println( "Length, Width, Height: " + box.length() + ", " + box.width() + ", " + box.height() ); System.out.println( "Weight, Volume: " + box.weight + ", " + box.volume ); System.out.println( "Cost to ship: " + box.shippingCost() ); cylinder = new CylindricalParcel( 2, .5 ); System.out.println( "Length, Radius: " + cylinder.length() + ", " + cylinder.radius() ); System.out.println( "Weight, Volume: " + cylinder.weight + ", " + cylinder.volume ); System.out.println( "Cost to ship: " + cylinder.shippingCost() ); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -