OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libjava/] [testsuite/] [libjava.lang/] [N19990310_5.java] - Blame information for rev 781

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 765 jeremybenn
/*--------------------------------------------------------------------------*/
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
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.