Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Java Program to sort integers in unsorted array

import java.util.Arrays;
public class Demo {
	public static void main(String[] args) {
		int[] arr = { 10, 14, 28, 11, 7, 16, 30, 50, 25, 18};
		System.out.println("The unsorted integer array = "+Arrays.toString(arr));
		int[] res = arr;
		Arrays.sort(res);
		System.out.println("The sorted integer array = "+Arrays.toString(res));
	}
}

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.