summaryrefslogtreecommitdiff
path: root/libjava/testsuite/libjava.lang/err2.java
blob: deeddf633e94491fa4ed6e34bddc18dee1cbe9e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*--------------------------------------------------------------------------*/
/* File name  : err2.java                                              */
/*            :                                                             */
/* Cause      : Operator "+=" error in char,byte,short type                 */
/*            :                                                             */
/* Message    : err2.java: In class `err2':                       */
/*            : err2.java: In method `main(java.lang.String[])':       */
/*            : err2.java:22: Incompatible type for `='. Explicit cast */
/*            :  needed to convert `int' to `byte'.                         */
/*            :                 a %= b;                                     */
/*            :                   ^                                         */
/*            : 1 error                                                     */
/*--------------------------------------------------------------------------*/

public class err2 {
  public static void main(String[] args) {
    byte a = -16;
    byte b = 10;

    a %= b;

    if ( a == -6 ) {
      System.out.println("OK");
    } else {
      System.out.println("a = " +a);
    }
  }
}