1 2 3 4 5 public class SuperClass implements org.quilt.cl.RunTest { 6 7 private String value = "not initialized"; 8 9 public SuperClass( String v ) { 10 value = v; 11 } 12 13 public SuperClass() { 14 value = "SuperClass"; 15 } 16 17 public String getValue() { 18 return value; 19 } 20 21 public int runTest(int x) { 22 if (!getValue().equals("SuperClass")) 23 throw new RuntimeException ( 24 "DefaultConstructor not called."); 25 return 3*x; 26 } 27 } 28 | Popular Tags |