Answers for "how to convert character array to char array in java 8"

27

java string to char array

String str = "example";
char[] ch = str.toCharArray();
Posted by: Guest on March-05-2020
0

converting char array to string

// Convert char array to String in Java
class Util
{
    public static void main(String[] args)
    {
        char[] chars = {'T', 'e', 'c', 'h', 'i', 'e', ' ', 
                        'D', 'e', 'l', 'i', 'g', 'h', 't'};
 
        String string = new String(chars);
        System.out.println(string);
    }
}
Posted by: Guest on February-26-2020

Code answers related to "how to convert character array to char array in java 8"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language