1// java convert array of char to string
2public class CharArrayToString
3{
4 public static void main(String[] args)
5 {
6 char[] charArray = new char[]{'F','l','o','w','e','r','B','r','a','c','k','e','t','s'};
7 String str = new String(charArray);
8 System.out.println(str);
9 }
10}
1String myString = "Hello, world!";
2char[] myCharArray = myString.toCharArray();
1// Convert char array to String in Java
2class Util
3{
4 public static void main(String[] args)
5 {
6 char[] chars = {'T', 'e', 'c', 'h', 'i', 'e', ' ',
7 'D', 'e', 'l', 'i', 'g', 'h', 't'};
8
9 String string = new String(chars);
10 System.out.println(string);
11 }
12}
13
1String s="abcd";
2char[] a=s.toCharArray();
3
4for(char c:a)
5{ System.out.println(c); }