Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package proj27012023;
- public class Box {
- private double length;
- private double width;
- private double height;
- public Box(double length, double width, double height) {
- super();
- this.length = length;
- this.width = width;
- this.height = height;
- }
- public double getLength() {
- return length;
- }
- public void setLength(double length) {
- this.length = length;
- }
- 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;
- }
- public double getVolume() {
- return length * width * height;
- }
- @Override
- public String toString() {
- return "Box [length=" + length + ", width=" + width + ", height=" + height + "]";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement