It seems to me that everything is fine but it is not working. Where is mistake?
package pl.codegym.task.task08.task0826;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.Collections;
/*
Pięciu wygranych
*/
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int[] tablica = new int[20];
for (int i = 0; i < tablica.length; i++) {
tablica[i] = Integer.parseInt(reader.readLine());
}
sortuj(tablica);
System.out.println(tablica[0]);
System.out.println(tablica[1]);
System.out.println(tablica[2]);
System.out.println(tablica[3]);
System.out.println(tablica[4]);
}
public static void sortuj(int[] tablica) {
int[] temp = tablica;
for (int i = 0; i < 20; i++) {
temp[i] *= -1;
}
Arrays.sort(temp);
for (int i = 0; i < 20; i++) {
temp[i] *= -1;
}
}
}