convert array of characters to string code example
Example 1: char array to string java
char[] a = {'h', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd'};
String str = new String(a);
Example 2: char array to string
String string = String.valueOf(a);
Example 3: java char array to string
final char[] charArray = { 'g','e','e','k','s','f','o','r','g','e','e','k','s' };
String string = new String(charArray);
System.out.println(string);
// -> "geeksforgeeks"