|
Last change
on this file since 141 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:
1.3 KB
|
| Line | |
|---|
| 1 | /*--------------------------------------------------------------------------*/
|
|---|
| 2 | /* Name : N19990310_5.java */
|
|---|
| 3 | /* : */
|
|---|
| 4 | /* Cause : A assignment operator makes error in char,byte,short array */
|
|---|
| 5 | /* : element */
|
|---|
| 6 | /* : */
|
|---|
| 7 | /* Message : In class `N19990310_5': */
|
|---|
| 8 | /* : In method `main(java.lang.String[])': */
|
|---|
| 9 | /* : Incompatible type for `='. Explicit cast needed to convert `*/
|
|---|
| 10 | /* : `int' to `char'. */
|
|---|
| 11 | /* : a[0] += (a[0] = 3); */
|
|---|
| 12 | /* : ^ */
|
|---|
| 13 | /* : 1 error */
|
|---|
| 14 | /*--------------------------------------------------------------------------*/
|
|---|
| 15 |
|
|---|
| 16 | public class N19990310_5 {
|
|---|
| 17 | public static void main(String[] args) {
|
|---|
| 18 | char[] a = {9};
|
|---|
| 19 | a[0] += (a[0] = 3);
|
|---|
| 20 |
|
|---|
| 21 | if ( a[0] == 12 ) {
|
|---|
| 22 | System.out.println("OK");
|
|---|
| 23 | } else {
|
|---|
| 24 | System.out.println("NG");
|
|---|
| 25 | }
|
|---|
| 26 | }
|
|---|
| 27 | }
|
|---|
| 28 |
|
|---|
| 29 |
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.