source: trunk/gcc/libjava/testsuite/libjava.lang/N19990310_4.java

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