2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / libjava / testsuite / libjava.lang / err6.java
blob4b06c6caa7ab3c228450aea731bc3d6ced73886d
1 /*--------------------------------------------------------------------------*/
2 /* File name : err6.java */
3 /* : */
4 /* Cause : Array evaluation order */
5 /* : */
6 /* Message : NG:[1]-->[4] */
7 /* : */
8 /* Note : JLS 15.9 Array Creation Expressions (p315--) */
9 /* : p318 line3 */
10 /* :[Each dimension expression is fully evaluated */
11 /* : before any part of any dimension expression to its right.] */
12 /*--------------------------------------------------------------------------*/
14 public class err6 {
15 public static void main(String[] args) {
16 int[] x = { 10, 11, 12, 1, 14 };
17 int[] y = { 1, 2, 3, 4, 5, 6 };
19 if ( x[(x=y)[2]] == 1 ) {
20 System.out.println("OK");
21 } else {
22 System.out.println("NG:[1]-->[" +x[(x=y)[2]]+ "]");