rectangle.java
来自「JAVA源代码程序aashjkjhkjhkjhjkhkj」· Java 代码 · 共 39 行
JAVA
39 行
/** * class to model a Rectangle */public class Rectangle extends Square { private int breadth ; public Rectangle() { length = 0 ; breadth = 0 ; } // end of constructor method public Rectangle(int l, int b) { length = l ; breadth = b ; } // end of constructor method public int getBreadth() { return breadth ; } // end of method getBreadth public int area() { return length * breadth ; } // end of method area public int perimeter() { return (length + breadth) * 2 ; } // end of method perimeter } // end of class Rectangle
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?