Horje
java string to char array Code Example
java string to char array
String str = "example";
char[] ch = str.toCharArray(); 
char array to string java
char[] a = {'h', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd'};
String str = new String(a);
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);
    }
}




20

Related
basic hello world program in java Code Example basic hello world program in java Code Example
java how to print an array Code Example java how to print an array Code Example
java random number Code Example java random number Code Example
hello world java Code Example hello world java Code Example
scanner in java Code Example scanner in java Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9