I\'m trying to make a program that consists of an array of 10 integers which all has a random value, so far so good.
However, now I need to sort them in order from l
MOST EFFECTIVE WAY!
public static void main(String args[]) { int [] array = new int[10];//creates an array named array to hold 10 int's for(int x: array)//for-each loop! x = ((int)(Math.random()*100+1)); Array.sort(array); for(int x: array) System.out.println(x+" "); }