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

gcc - MinGW's ld cannot perform PE operations on non PE output file -

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

c# - Search and Add Comment with OpenXML for Word -