(String[] args)
| 8 | |
| 9 | public class ModifyExisting { |
| 10 | public static void main(String[] args) { |
| 11 | double[] da = new double[7]; |
| 12 | Arrays.setAll(da, new Rand.Double()::get); |
| 13 | show(da); |
| 14 | Arrays.setAll(da, n -> da[n] / 100); // [1] |
| 15 | show(da); |
| 16 | } |
| 17 | } |
| 18 | /* Output: |
| 19 | [4.83, 2.89, 2.9, 1.97, 3.01, 0.18, 0.99] |