having new variable 'inter' in-between "reorder/antialias" and "hybrid" in order...
[IRC.git] / Robust / src / Tests / AssignmentConversionTest.java
1 class AssignmentConversionTest {
2     public static final int sfi = 100;
3   
4     public static void main(String[] args) {
5         short s = 12;           // narrow 12 to short
6         float f = s;            // widen short to float
7         System.out.println("f=12 : " + (int)f);
8
9         char c = '\u0009';
10         int l = c;         // widen char to int
11         System.out.println("l=0x9 : 0x" + Integer.toString(l));
12
13         f = 1.23f;
14         double d = f;           // widen float to double
15         System.out.println("d=123 : " + (int)(d*100));
16         
17         s = AssignmentConversionTest.sfi;
18         System.out.println("s=100 : " + s);
19         
20         s = 12+2;
21         System.out.println("s=12+2=" + (12+2) + ": "+ s);
22         
23         s = 12-2;
24         System.out.println("s=12-2=" + (12-2) + ": "+ s);
25         
26         s = 12*2;
27         System.out.println("s=12*2=" + (12*2) + ": "+ s);
28         
29         s = 12/2;
30         System.out.println("s=12/2=" + (12/2) + ": "+ s);
31         
32         s = 12%2;
33         System.out.println("s=12%2=" + (12%2) + ": "+ s);
34         
35         s = 12|2;
36         System.out.println("s=12|2=" + (12|2) + ": "+ s);
37         
38         s = 12^2;
39         System.out.println("s=12^2=" + (12^2) + ": "+ s);
40         
41         s = 12&2;
42         System.out.println("s=12&2=" + (12&2) + ": "+ s);
43         
44         s = 12>2?1:2;
45         System.out.println("s=12>2?1:2=" + (12>2?1:2) + ": "+ s);
46         
47         s = 12<2?1:2;
48         System.out.println("s=12<2?1:2=" + (12<2?1:2) + ": "+ s);
49         
50         /*       
51         byte a = 12<2;
52
53         s = 12%2?1:2;
54         System.out.println("s=12&2=" + (12%2?1:2) + ": "+ s);
55         
56         short se = 123;
57         char ce = se;         // error: would require cast
58         se = ce;              // error: would require cast
59         */
60     }
61 }