Код: Выделить всё
// Java
int i = 0;
int[] a = {10, 20, 30, 40, 50, 60};
a[++i] = a[i++] = a[++i] = ++i;
System.out.println(Arrays.toString(a));
// [10, 4, 30, 4, 50, 60]
Мы можем даже упростить этот пример:
Код: Выделить всё
int i = 0;
int[] a = {10, 20};
a[i] = ++i;
System.out.println(Arrays.toString(a));
// [1, 20]
Подробнее здесь: https://stackoverflow.com/questions/793 ... on-in-java
Мобильная версия