I want to perform a deep copy on an object, does the clone
function work to that extent, or do I have to create a function to physically copy it, and return a pointer to it? That is, I want
Board tempBoard = board.copy();
This would copy the board object into the tempBoard, where the board object holds:
public interface Board {
Board copy();
}
public class BoardConcrete implements Board {
@override
public Board copy() {
//need to create a copy function here
}
private boolean isOver = false;
private int turn;
private int[][] map;
public final int width, height;
}