Converting a character array to a String

The String class has a useful contructor especially for this, as you can see in the following example:

public class TestProg
{
    public static void main(String args[])
    {
        char [] array = {'H','e','l','l','o',',',' ','w','o','r','l','d','!' };
        String s = new String(array);
        System.out.println(s);   // prints out: Hello, world!
    }
}