It is necessary to sort an array, but the compiler swears, gives an error
possible lossy conversion from double to int
What mistake do I make?
int[] mas = {9,6,3,8,5,2,7,4,1}; for (int i = 0; i < mas.length; i++) { mas[i] = Math.floor(Math.random() * 8); } for (int i = 0; i < mas.length; i++) { System.out.print(mas[i] + " "); }