Advertisement
droidus

Untitled

Sep 28th, 2011
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.22 KB | None | 0 0
  1. public class Box {
  2.  
  3.     private double height;
  4.     private double width;
  5.     private double depth;
  6.     private boolean full = false;
  7.    
  8.     Box(double height, double width, double depth, boolean full) {
  9.         this.height = height;
  10.         this.width = width;
  11.         this.depth = depth;
  12.         this.full = false;
  13.     }
  14.    
  15.     /**
  16.      * @return the height
  17.      */
  18.     public double getHeight() {
  19.         return height;
  20.     }
  21.     /**
  22.      * @param height the height to set
  23.      */
  24.     public void setHeight(double height) {
  25.         this.height = height;
  26.     }
  27.     /**
  28.      * @return the width
  29.      */
  30.     public double getWidth() {
  31.         return width;
  32.     }
  33.     /**
  34.      * @param width the width to set
  35.      */
  36.     public void setWidth(double width) {
  37.         this.width = width;
  38.     }
  39.     /**
  40.      * @return the depth
  41.      */
  42.     public double getDepth() {
  43.         return depth;
  44.     }
  45.     /**
  46.      * @param depth the depth to set
  47.      */
  48.     public void setDepth(double depth) {
  49.         this.depth = depth;
  50.     }
  51.     /**
  52.      * @return the full
  53.      */
  54.     public boolean isFull() {
  55.         return full;
  56.     }
  57.     /**
  58.      * @param full the full to set
  59.      */
  60.     public void setFull(boolean full) {
  61.         this.full = full;
  62.     }
  63.  
  64.     /* (non-Javadoc)
  65.      * @see java.lang.Object#toString()
  66.      */
  67.     @Override
  68.     public String toString() {
  69.         return height + "x" + width + "x" + depth;
  70.     }
  71.    
  72.    
  73. }
  74.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement