GNU header update.
[cacao.git] / tests / kaffe / CharCvt.java
1 /**
2  * this class tests some aspects of the conversion 
3  * between ints, shorts, and chars
4  */
5 public class CharCvt
6 {
7     static void print_as_int(char x)
8     {
9         System.out.println((int)x);
10     }
11
12     static void print_as_int(short x)
13     {
14         System.out.println((int)x);
15     }
16
17     static char make_a_char(int x)
18     {
19         return (char)x;
20     }
21
22     static short make_a_short(int x)
23     {
24         return (short)x;
25     }
26
27     public static void main(String av[])
28     {
29         print_as_int(make_a_char(-1));
30         print_as_int(make_a_short(-1));
31     }
32 }
33
34 /* Expected Output:
35 65535
36 -1
37 */