Commit 7e5fb883 authored by Rohit Prasad's avatar Rohit Prasad

Implement constructor to create object from its own instance

parent dc3bc8fd
...@@ -3,4 +3,8 @@ public class BuyOrder extends Order { ...@@ -3,4 +3,8 @@ public class BuyOrder extends Order {
BuyOrder(int time, Customer c, Stock stock, int qty, float price) { BuyOrder(int time, Customer c, Stock stock, int qty, float price) {
super(time, "BUY", c, stock, qty, price); super(time, "BUY", c, stock, qty, price);
} }
BuyOrder(BuyOrder b) {
super(b);
}
} }
...@@ -2,4 +2,8 @@ public class SellOrder extends Order { ...@@ -2,4 +2,8 @@ public class SellOrder extends Order {
SellOrder(int time, Customer c, Stock stock, int qty, float price) { SellOrder(int time, Customer c, Stock stock, int qty, float price) {
super(time, "SELL", c, stock, qty, price); super(time, "SELL", c, stock, qty, price);
} }
SellOrder(SellOrder s) {
super(s);
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment