title: StringBuffer Array to String Array - Java
body: <p>I need to convert a StringBuffer Array to String Array for sorting. Is there any method in Java?</p>
  
  <p>Below is my code and i am trying to sort the values(input1) in alphabetical order that contains the first letter as UpperCase and ignoring other values.</p>
  
  <pre><code>import java.util.*;
  public class IPLMatch
  {
      public static void main(String args[])
      {
  
          int input1 = 4;
          String input2[] = {"One","two","Three","foUr"}, output[];
          StringBuffer[] temp = new StringBuffer[input1];
          int j = 0, k = 0;
          for(int i = 0; i &lt; input1; i++)
          {
              boolean isUpperCase = Character.isUpperCase(input2[i].charAt(0));
              if(isUpperCase)
              {
                  temp[j++] = new StringBuffer(input2[i]);
              }
          }
                  //I need convert my stringbuffer array (temp) to String array for sorting
          Arrays.sort(temp); 
          System.out.print("{");
          for(int i = 0; i &lt; temp.length; i++)
          {
              System.out.print( temp[i]+ ",");
          }
          System.out.print("\b}");
      }
  }
  </code></pre>