OSDN Git Service

Add NIOS2 support. Code from SourceyG++.
[pf3gnuchains/gcc-fork.git] / libjava / testsuite / libjava.lang / err2.java
1 /*--------------------------------------------------------------------------*/
2 /* File name  : err2.java                                              */
3 /*            :                                                             */
4 /* Cause      : Operator "+=" error in char,byte,short type                 */
5 /*            :                                                             */
6 /* Message    : err2.java: In class `err2':                       */
7 /*            : err2.java: In method `main(java.lang.String[])':       */
8 /*            : err2.java:22: Incompatible type for `='. Explicit cast */
9 /*            :  needed to convert `int' to `byte'.                         */
10 /*            :                 a %= b;                                     */
11 /*            :                   ^                                         */
12 /*            : 1 error                                                     */
13 /*--------------------------------------------------------------------------*/
14
15 public class err2 {
16   public static void main(String[] args) {
17     byte a = -16;
18     byte b = 10;
19
20     a %= b;
21
22     if ( a == -6 ) {
23       System.out.println("OK");
24     } else {
25       System.out.println("a = " +a);
26     }
27   }
28 }