java put a char array into a string

Java
char[] arr = { 'p'," ",'q', 'r', 's' };
      String str = String.valueOf(arr);
      System.out.println(str);//"p qrs"
Source

Also in Java: