I have seen different approaches to define a static array in Java. Either:
String[] suit = new String[] {
"spades",
"hearts",
"diamonds",
"clubs"
};
...or only
String[] suit = {
"spades",
"hearts",
"diamonds",
"clubs"
};
or as a List
List suit = Arrays.asList(
"spades",
"hearts",
"diamonds",
"clubs"
);
Is there a difference (except for the List definition of course)?
What is the better way (performance wise)?