Try something like. List<String> myList = new ArrayList<String>(Arrays.asList(s.split(",")));. Arrays.asList documentation · String.split ... ... <看更多>
Search
Search
Try something like. List<String> myList = new ArrayList<String>(Arrays.asList(s.split(",")));. Arrays.asList documentation · String.split ... ... <看更多>
In Java, filling an ArrayList of type String with Strings. ... Java ArrayList | User defined Objects by taking user input with Example. ... <看更多>
Have you considered that ArrayList could be a little overkill? If your list will always be a defined length, you could use a String[] to ... ... <看更多>