表示這是TableDeque
類的構造函數(實現了Deque
),並且該類中有更多的節點。如何製作一個構造函數來複制包含所有節點信息的原始構造函數?
public TableDeque() {
head = new Node<Customer>(null);
tail = new Node<Customer>(null);
head.join(tail);
size = 0;
this.setImage("table");
}
我希望做一個複製TableDeque
,所以我宣佈另一個構造函數TableDeque
作爲參數
public TableDeque (TableDeque copy) {
this();
// copy properties from the source TableDeque to the new instance
}
因此,TableDeque(this)
必須返回重複原來所有的節點信息,但我不知道該怎麼做。
我一直思索和嘗試自己做,但我仍然停留在這個:(請給我解決