Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class FahadP2 {
- public double width;
- public double height;
- public void Rectangle()
- {
- width=8;
- height=9;
- }
- void Rectangle (double newWidth, double newHeight)
- {
- width=newWidth;
- height=newHeight;
- }
- public double getArea()
- {
- return 2.0*(width+height);
- }
- public double getWidth() {
- return width;
- }
- public void setWidth(double width) {
- this.width=width;
- }
- public double getHeight() {
- return height;
- }
- public void setHeight(double height) {
- this.height= height;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement