You forgot to add the values of the array up. Here is an answer showing the arrays contents step-by-step using the other suggestions for correct copying of arrays and setting c1 to the right length.
// Prints out array contents and sum
public static void printSumArray( Integer[] iArray){
int iCumulativeSum = 0;
for (int i = 0; i < iArray.length; i++)
{
System.out.print( " " + iArray[i] + " " );
iCumulativeSum += iArray[i];
}
System.out.println(" Cumulative Sum = " + iCumulativeSum);
}
public static void main(String[] args) {
Integer[] c = {3,2,4,1,0};
Integer[] c1 = new Integer[c.length];
System.out.print("Original Array c: ");
printSumArray(c);
Arrays.sort(c);
System.out.print("Sorted Array c: ");
printSumArray(c);
System.arraycopy(c, 0, c1, 0, c.length);
Arrays.sort(c1,Collections.reverseOrder());
System.out.print("Reversed Sorted c1: ");
printSumArray(c1);
}
output:
Original Array c: 3 2 4 1 0 Cumulative Sum = 10
Sorted Array c: 0 1 2 3 4 Cumulative Sum = 10
Reversed Sorted c1: 4 3 2 1 0 Cumulative Sum = 10
System.out.println(Arrays.asList(c1))