Character Array to String in Java

public class CharArrayToString {
       
        public static void main(String args[]){
                char[] charArray = new char[]{'F','O','R','G','E','T','C','O','D','E'};
                String str = new String(charArray);
                System.out.println("Char array converted to String: " + str);
        }
}