我正在尝试创建我的 Board 对象的副本,但它似乎没有实例化。有人能告诉我为什么吗?
class Board {
private Board _copyBoard;
private int _size;
public Board (int N) {
_size = N;
}
public Board (Board b) {
this._copyBoard = b;
}
int size() {
return _size;
}
}
当我做:
Board b = new Board(4);
Board x = new Board(b);
System.out.println(x.size()); --> 0 instead of 4.