0

my class has an enum definition as property, and an enums type array as property
like this:

public class GameBoard implements Serializable , Cloneable {
    
    private final int N = 8;
    public State[][] Board = new State[N][N];
    public enum State
    {
      empty,player1,player2;   
    }

i want to write a clone method in this class. if i will use a copy method that is defined in Object class will i get a "deep copy" of the class and copy the array or will it only return a reference to the array?

i'm not sure if enum is considered a "basic" type when it comes to copy.

2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by emilio
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.