I need to store in a constant class 4 letter of a code. I can do:
static final String CODE_LETTERS = "TRWAG";
or
static final char[] CODE_LETTERS = {'T', 'R', 'W', 'A', 'G'};
After, I can obtain one of that characters in two ways:
final char codeLetter = CODE_LETTERS.charAt(index);
or
final char codeLetter = CODE_LETTERS[index];
what is the best way?. Please take in mind correction, performance, etc.