1String [] strings = new String [] {"1", "2" };
2List<String> stringList = new ArrayList<String>(Arrays.asList(strings)); //new ArrayList is only needed if you absolutely need an ArrayList
1ArrayList<String> al = new ArrayList<String>();
2 al.add("Hello");
3 al.add("Wor");
4 al.add("ld");
5 StringBuffer sb = new StringBuffer();
6
7 for (String s : al) {
8 sb.append(s);
9 sb.append(" ");
10 }
11 String str = sb.toString();
12 System.out.println(str);//"Hello wor ld"
1String [] strings = new String [] {"1", "2" };
2List<String> stringList = new ArrayList<String>(Arrays.asList(strings)); //new ArrayList is only needed if you absolutely need an ArrayList
3