having new variable 'inter' in-between "reorder/antialias" and "hybrid" in order...
[IRC.git] / Robust / src / Tests / StaticInnerClassTest.java
1 interface Contents {
2   int value();
3 }
4
5
6 public interface Destination {
7   String readLabel();
8 } ///:~
9
10 public class StaticInnerClassTest {
11   public StaticInnerClassTest(){}
12   
13   private static class ParcelContents implements Contents {
14     private int i;
15     
16     public ParcelContents() {i = 11;}
17     public int value() { return i; }
18   }
19   
20   protected static class ParcelDestination
21   implements Destination {
22     private String label;
23     private ParcelDestination(String whereTo) {
24       label = whereTo;
25     }
26     public String readLabel() { return label; }
27     // Nested classes can contain other static elements:
28     public static void f() {}
29     static int x;
30     static {
31       x = 10;
32     }
33     static class AnotherLevel {
34       public static void f() {}
35       static int x;
36       static {
37         x = 10;
38       }
39     }
40   }
41     
42   public static Destination destination(String s) {
43     return new ParcelDestination(s);
44   }
45   
46   public static Contents contents() {
47     return new ParcelContents();
48   }
49   
50   public static void main(String[] args) {
51     Contents c = contents();
52     Destination d = destination("Tasmania");
53     System.out.println(d.readLabel());
54   }
55 } ///:~