Why does this work:
String[] array = {"a", "b", "c"};
List<String> list = Arrays.asList(array);
but this does not:
List<String> list = Arrays.asList({"a","b","c"});
This is a short hand only available when constructing and assigning an array.
String[] array = {"a", "b", "c"};
You can do this though:
List<String> list = Arrays.asList("a","b","c");
As asList
can take "vararg" arguments.