Consider I am having the following enum class,
public enum Sample { READ, WRITE }
and in the following class I am trying to test th
You cannot create a new enum instance. Otherwise it won't be an enum. You can reference an already existing enum. As in your example
Sample sample = Sample.READ;