6 public interface Destination {
10 public class StaticInnerClassTest {
11 public StaticInnerClassTest(){}
13 private static class ParcelContents implements Contents {
16 public ParcelContents() {i = 11;}
17 public int value() { return i; }
20 protected static class ParcelDestination
21 implements Destination {
23 private ParcelDestination(String whereTo) {
26 public String readLabel() { return label; }
27 // Nested classes can contain other static elements:
28 public static void f() {}
33 static class AnotherLevel {
34 public static void f() {}
42 public static Destination destination(String s) {
43 return new ParcelDestination(s);
46 public static Contents contents() {
47 return new ParcelContents();
50 public static void main(String[] args) {
51 Contents c = contents();
52 Destination d = destination("Tasmania");
53 System.out.println(d.readLabel());