Answers for "wraping list to string java"

0

wraping list to string java

public static void main(String[] args) {
	try {
        List<Character> list =  
                Arrays.asList('c', 's', 'v'); 
        StringBuilder sb = new StringBuilder(); 
        for (Character chr : list) { 
            sb.append(chr); 
        } 
        // convert to string 
        String result = sb.toString(); 
        System.out.println(result); 
	} catch (Exception e) {
		e.printStackTrace();
	}
}

Output:
csv
Posted by: Guest on June-24-2020

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language