Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class SurfaceArea {
- int width, height, depth, surface;
- public SurfaceArea(int width, int height) { //2d box
- this.width = width;
- this.height = height;
- surface = width*height;
- }
- public SurfaceArea(int width, int height, int depth) { //3d box
- this.width = width;
- this.height = height;
- this.depth = depth;
- surface = width*height*depth;
- }
- public getDepth() {
- return this.depth;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement