4 ms·
Yeah, I don't touch Java very often (and my Java is more sledgehammer than scalpel at the best of times), but off the top of my head I'd reduce the example to:
by HillRat 13y ago
Yeah, I don't touch Java very often (and my Java is more sledgehammer than scalpel at the best of times), but off the top of my head I'd reduce the example to:
int[] arr = new int[50];
for(int x =2; x <= 100; x = x+2){arr[(x/2)-1] = x;}
int[] arr2 = Arrays.copyOfRange(arr,5,arr.length);
There's probably a more fluent method to achieve the same result (in Scala, F# and C#, certainly there are), but I'd like to see a considerably less-contrived example from a more-disinterested party.