Java-Error trying to sort an int
<pre><code>package programame;

import java.util.Scanner;
import java.util.Arrays;

public class E100 {
public static int ascendente(int a) 
{
    String str = Integer.toString(a);
    String max[] = str.split("");
    Arrays.sort(max);
    String str1 = Arrays.toString(max);
    int ascendente = Integer.parseInt(str1);
    return ascendente;
}
public static void main(String args[]) {
    Scanner sc = new Scanner(System.in);
    int intentos = sc.nextInt();
    int x = sc.nextInt();
    System.out.println(ascendente(x));
    }
}
</code></pre>

<p>Hi, I am trying to sort an int read from a scanner, but everytime I run it it gives me the error = </p>

<pre><code> Exception in thread "main" java.lang.NumberFormatException: For input string: "[3, 4, 6, 7]"   at
 java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)   at java.lang.Integer.parseInt(Integer.java:580)     at
 java.lang.Integer.parseInt(Integer.java:615)    at
 programame.E100.ascendente(E100.java:18)    at
 programame.E100.main(E100.java:25)

 C:\Users\agn12\AppData\Local\NetBeans\Cache\8.1\executor-snippets\run.xml:53: Java returned: 1
</code></pre>