Sorry for probably easy question.
I need array of flags
boolean[20] isTownVisited
But it is not convient to use int in it, i want to use strings:
isTownVisited[Town.Milan] = true;
or
return isTownVisited[Town.Rome]
I've tried to declare enum
enum Town {Milan, Rome, Florence, Napoli}
But I still can't use it to index my boolean array. How to fix this problem, may I write something like:
enum Town {Milan = 0, Rome = 1, Florence = 2, Napoli = 3}