더 좋은 풀이 있으면 공유합시다..
package myTest;
import java.util.Arrays;
public class Test {
public static void main(String[] args) {
Test test = new Test();
System.out.println(test.reverseInt(13245768));
}
public int reverseInt(int n) {
char[] chars = (n+"").toCharArray();
Arrays.sort(chars);
StringBuilder sb = new StringBuilder(new String(chars)).reverse();;
return Integer.parseInt(sb.toString());
}
}