Advertisement
Guest User

Untitled

a guest
Nov 28th, 2014
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. class SurfaceArea {
  2. int width, height, depth, surface;
  3.  
  4. public SurfaceArea(int width, int height) { //2d box
  5. this.width = width;
  6. this.height = height;
  7. surface = width*height;
  8. }
  9.  
  10. public SurfaceArea(int width, int height, int depth) { //3d box
  11. this.width = width;
  12. this.height = height;
  13. this.depth = depth;
  14. surface = width*height*depth;
  15. }
  16.  
  17. public getDepth() {
  18. return this.depth;
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement