Make use of Java's robust library:
// filled with various ints
int[] a;
// temporary variable for swapping values
int temp;
// sort with fast, built-in algorithm
java.util.Arrays.sort(a);
// reverse the array
for( int i = 0; i < a.length/2; ++i ) {
temp = a[i];
a[i] = a[a.length - i - 1];
a[a.length - i - 1] = temp;
}
Obviously, if you're concerned with execution speed you could
write your own sort method which would sort into descending order
instead of ascending order (perhaps by modifying Java's sort
algorithm).