rectangle.java~3~

来自「继承和多态 实验目的: 1、 掌握继承和多态的概念与实现方法 2、 掌握如」· JAVA~3~ 代码 · 共 35 行

JAVA~3~
35
字号
package generalSort;

/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2008</p>
 *
 * <p>Company: </p>
 *
 * @author not attributable
 * @version 1.0
 */
public class Rectangle {
    private int Len;
    private int Width;
    public Rectangle() {
    }

    public Rectangle(int len, int width) {
        this.Len = len;
        this.Width = width;
    }

    public int area() {
        return this.Len * this.Width;
    }

    public String toString() {
        return "The current rectangle's length, width, and area is " + this.Len +
                "    " + this.Width + "    " + this.area();
    }
}

⌨️ 快捷键说明

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