In my String, I can have an arbitrary number of words which are comma separated. I wanted each word added into an ArrayList. E.g.:
String s = \"a,b,c,d,e,...
Option1:
List list = Arrays.asList("hello");
Option2:
List list = new ArrayList(Arrays.asList("hello"));
In my opinion, Option1 is better because
asList method creates and returns an ArrayList Object.Please refer to the documentation here