Skip to content

Commit 0a625cb

Browse files
hansonrhansonr
authored andcommitted
Test_Array doublecheck of a[--i] *=
- working fine
1 parent 333859d commit 0a625cb

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

sources/net.sf.j2s.java.core/src/test/Test_Array.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package test;
22

33
import java.lang.reflect.Array;
4+
import java.util.Arrays;
45

56
class Test_Array extends Test_ {
67

@@ -52,6 +53,14 @@ class Test_Array extends Test_ {
5253

5354
public static void main(String[] args) {
5455

56+
57+
int[] a = new int[] {1,2,3};
58+
int i = 2, jj;
59+
a[--i] *= a[i + 1];
60+
// a[--i] = a[jj = i] + a[i + 1];
61+
System.out.println(Arrays.toString(a));
62+
a[i--] = a[i] + a[i + 1];
63+
System.out.println(Arrays.toString(a));
5564
Object[][] oaa = new Object[2][];
5665

5766

0 commit comments

Comments
 (0)