23
Apr
1. Write a program to sort numeric numbers.
import java.util.Arrays;
public class Main {
public static void main(String[] args) {
int[] numbers={14,12,9,15,17,21,23,5,8,25};
Arrays.sort(numbers);
System.out.println(Arrays.toString(numbers));
}
}
Output:
[5, 8, 9, 12, 14, 15, 17, 21, 23, 25]