Answers for "java convert a char[] to string"

0

java convert a char[] to string

char[] chars = { 'A', 'B', 'C', 'D', 'E', 'F' };

String str1 = String.valueOf(chars); //"ABCDEF"
String str2 = new String(chars);// "ABCDEF"

System.out.println(str1.equals(str2)); //"true"
Posted by: Guest on March-20-2020

Code answers related to "java convert a char[] to string"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language