|
Last change
on this file since 3103 was 2, checked in by bird, 23 years ago |
|
Initial revision
|
-
Property cvs2svn:cvs-rev
set to
1.1
-
Property svn:eol-style
set to
native
-
Property svn:executable
set to
*
|
|
File size:
854 bytes
|
| Line | |
|---|
| 1 | // This test case was built for java/3096.
|
|---|
| 2 |
|
|---|
| 3 | class PR3096
|
|---|
| 4 | {
|
|---|
| 5 | static void foo (int x[], int i) {
|
|---|
| 6 | ++x[i];
|
|---|
| 7 | }
|
|---|
| 8 | static void foo (float x[], int i) {
|
|---|
| 9 | ++x[i];
|
|---|
| 10 | }
|
|---|
| 11 | public static void main(String [] args) {
|
|---|
| 12 | int a[] = new int [1];
|
|---|
| 13 | float f[] = new float [1];
|
|---|
| 14 | int b[];
|
|---|
| 15 | int i = 0;
|
|---|
| 16 | foo (a,0);
|
|---|
| 17 | foo (f,0);
|
|---|
| 18 | System.out.println (a[0]);
|
|---|
| 19 | System.out.println (f[0]);
|
|---|
| 20 | System.out.println ((b=a)[0]);
|
|---|
| 21 | (b=a)[i]=99;
|
|---|
| 22 | b[0]++;
|
|---|
| 23 | System.out.println (a[0]+", "+b[0]);
|
|---|
| 24 | System.out.println (++a[i]);
|
|---|
| 25 | System.out.println (a[i]);
|
|---|
| 26 | System.out.println (a[i]++);
|
|---|
| 27 | System.out.println (a[i]);
|
|---|
| 28 | String s[] = new String [1];
|
|---|
| 29 | String y[];
|
|---|
| 30 | s[0]="";
|
|---|
| 31 | s[0] += "Peace ";
|
|---|
| 32 | System.out.println (s[0]);
|
|---|
| 33 | (y=s)[0] += "now!";
|
|---|
| 34 | System.out.println (s[0]+", "+y[0]);
|
|---|
| 35 | }
|
|---|
| 36 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.