-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBoxWeight.java
More file actions
42 lines (35 loc) · 1.12 KB
/
BoxWeight.java
File metadata and controls
42 lines (35 loc) · 1.12 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
// import java.util.ArrayList;
// import java.lang.reflect.Parameter;
public class BoxWeight extends Box{
double weight;
// double s;
// double b;
public BoxWeight() {
// super(s);
// this.l = s;
// this.b = s;
// this.w = weight;
this.weight = -1;
}
// @Override
// static void greeting() {
// System.out.println("Hey, I am in BoxWeight class. Greetings!");
// ArrayList list = new ArrayList();
// }
BoxWeight (BoxWeight old) {
super(old);
weight = old.weight;
}
BoxWeight(double side) {
super(side); // Calling the other constructor of the Box class with only one side
System.out.println("Hello i am Overriding");
// this.weight = weight;
}
// Parameterized Parameter
public BoxWeight(double l, double h, double w, double weight) {
// used to initialise values present in parent class
super(l, h, w); // what is this? call the parent class constructor
// System.out.println(super.weight);
this.weight = weight;
}
}