title: Difference between new String(char[]) and char[].toString
body: <p>The output for following two code blocks in Java is different. I am trying to understand why.</p>
  
  <pre><code>private String sortChars(String s){
        char[] arr = s.toCharArray(); //creating new char[]
         Arrays.sort(arr); //sorting that array
          return new String(arr);  
      }
  </code></pre>
  
  <p>This one returns a string with sorted characters as expected.</p>
  
  <pre><code>private String sortChars(String s){
        char[] arr = s.toCharArray(); //creating new char[]
         Arrays.sort(arr); //sorting that array
          return arr.toString();
      }
  </code></pre>
  
  <p>Sorry. My bad!
  Using to compare two strings.
  The output to second string looks like this as suggested by many - 
  [C@2e0ece65</p>
  
  <p>Thanks!</p>