but every time I try it I get this output and this error
Code:
--------------------Configuration: <Default>--------------------
0,133,44444444,555555,125,666,8907,
0,8907,125,133,44444444,555555,666,
0,125,133,44444444,555555,666,8907,
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.charAt(String.java:686)
at Sort007.main(007.java:21)

It's telling you exactly what's wrong. On line 21, you're trying to access a String index of -1, which is obviously a no-no.

If you want more help, you'll have to post some formatted code using the code tags. Also, you should use more meaningful variable names that follow the standard naming conventions (variables start with a lower-case letter, for example) if you want other people to read through your code.

That's fine. It doesn't change anything I told you. What are you doing on line 21? Step through it with a debugger if you can't figure out what's going on. At least put some print statements in there so you know what index you're trying to access (hint: it's -1, and it shouldn't be).