Saturday, 17 August 2013

Java - iterate a for loop in a given order

Java - iterate a for loop in a given order

In Bash, if I wanted to iterate through elements of an array in a given
order, I could do so like this:
for i in 1 3 8 2 5 9; do
array[i] = <some_algorithm_based_value>
done
Is it possible to do the same (or relatively the same) thing in Java?

No comments:

Post a Comment