Why is not the inverted array displayed? that is, the last element of the array should be the first, and so on.
public class Mane { public void sort(int[] massive){ int[]arraySort = new int[10]; for(int i = 4; i >= 0; i--){ arraySort[4 - i] = massive[i]; for(int a = 0; a < 5; a++){ massive[a] = arraySort[a]; } } } public static void main(String[] arg){ int[] mass = {1,2,3,4,5}; Mane m = new Mane(); m.sort(mass); for(int i: mass){ System.out.println(i); } } }