-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTest.java
More file actions
43 lines (29 loc) · 1.34 KB
/
Test.java
File metadata and controls
43 lines (29 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//Sakib Ahmed Shishir - 2312546642
package com.mycompany.box;
public class Test {
public static void main(String[] args)
{
Box box1 = new Box(3, 4, 5); //creating object
Box box2 = new Box(box1);
Box box3 = new Box(5);
System.out.println("box1: " + box1.toString());
System.out.println("box2: " + box2.toString());
System.out.println("box3: " + box3.toString());
System.out.println("box1 width: " + box1.getWidth());
System.out.println("box1 height: " + box1.getHeight());
System.out.println("box1 depth: " + box1.getDepth());
box1.setWidth(7);
box1.setHeight(8);
box1.setDepth(9);
System.out.println("Changed box1: " + box1.toString());
System.out.println("");
System.out.println(":Equality check ");
System.out.println("Is box1 equal to box2? " + box1.equalTo(box2));
System.out.println("Is box1 equal to box3? " + box1.equalTo(box3));
System.out.println(" ");
System.out.println("Volume of the boxes: ");
System.out.println("Volume of box1: " + box1.volume());
System.out.println("Volume of box2: " + box2.volume());
System.out.println("Volume of box3: " + box3.volume());
}
}