Advertisement
Guest User

Untitled

a guest
Jan 27th, 2020
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. public class FahadP2 {
  2. public double width;
  3. public double height;
  4.  
  5. public void Rectangle()
  6. {
  7. width=8;
  8. height=9;
  9. }
  10. void Rectangle (double newWidth, double newHeight)
  11. {
  12. width=newWidth;
  13. height=newHeight;
  14. }
  15. public double getArea()
  16. {
  17. return 2.0*(width+height);
  18. }
  19. public double getWidth() {
  20. return width;
  21. }
  22. public void setWidth(double width) {
  23. this.width=width;
  24. }
  25. public double getHeight() {
  26. return height;
  27. }
  28. public void setHeight(double height) {
  29. this.height= height;
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement