title: Arrange given numbers to form the biggest number
body: <p>For a given number I want to generate the biggest number from the number's digits.</p>
  
  <p>For example: Input: 3134059 The largest number is: 9543310 And the smallest number is: 1033459</p>
  
  <p>Errors:</p>
  
  <pre><code>Main.java:18: error: ';' expected
          public int compare(String X,String Y){
                            ^
  Main.java:18: error: ';' expected
          public int compare(String X,String Y){
                                            ^
  Main.java:18: error: not a statement
          public int compare(String X,String Y){
                                             ^
  Main.java:18: error: ';' expected
          public int compare(String X,String Y){
                                              ^
  4 errors
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>import java.util.*;
  public class Main
  {
      public static void main(String[] args) {
          Scanner sc=new Scanner(System.in);
          System.out.println("Enter The Size of Array");
          int n=sc.nextInt();
          String[] arr=new String[n];
          for(int i=0;i&lt;n;i++){
              arr[i]=sc.nextString();
          }
          printLargest(arr);
  
      }
      static void printLargest(String[] arr){
          Arrays.sort(arr, new Comparator&lt;String&gt;());
          @Override
          public int compare(String X,String Y){
              String XY=X+Y;
              String YX=Y+X;
              return XY.compareTo(YX)?1:-1;
          }
          for(int i=0;i&lt;arr.length;i++){
              System.out.print(arr[i]+" ");
          }
      }
  
  }
  </code></pre>