java - sorting an array in the same line as instantiation/initialization -


if given array of ints:

int[] age = new int [] {32, 25, 56, 56, 12, 20, 22, 19, 54, 22}; 

is there way sort(lowest-highest) in same line instantiation/initialization, elements of age be: 12, 19, 20, 22...?

not same line.

but can do:

public static int[] sort(int[] a) {    arrays.sort(a);    return a; } // ... int[] age = sort(new int[] {32, 25, 56, 56, 12, 20, 22, 19, 54, 22}); 

Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -