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] - Rev 767

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

/*--------------------------------------------------------------------------*/
/* Name       : N19990310_5.java                                            */
/*            :                                                             */
/* Cause      : A assignment operator makes error in char,byte,short array  */
/*            : element                                                     */
/*            :                                                             */
/* Message    : In class `N19990310_5':                                     */
/*            : In method `main(java.lang.String[])':                       */
/*            : Incompatible type for `='. Explicit cast needed to convert `*/
/*            : `int' to `char'.                                            */
/*            :                 a[0] += (a[0] = 3);                         */
/*            :                      ^                                      */
/*            : 1 error                                                     */
/*--------------------------------------------------------------------------*/
 
public class N19990310_5 {
	public static void main(String[] args) {
		char[] a = {9};
		a[0] += (a[0] = 3);
 
		if ( a[0] == 12 ) {
			System.out.println("OK");
		} else {
			System.out.println("NG");
		}
	}
}
 
 
 

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

powered by: WebSVN 2.1.0

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