/Users/lyon/j4p/src/bookExamples/ch06RefDataTypes/AbstractClass2.java

1    package bookExamples.ch06RefDataTypes; 
2     
3    /** 
4     * DocJava, Inc. 
5     * http://www.docjava.com 
6     * Programmer: dlyon 
7     * Date: Sep 14, 2004 
8     * Time: 3:12:52 PM 
9     */ 
10    public  abstract class AbstractClass2  { 
11       abstract Object compute(); 
12       public static void main(String[] args) { 
13           AbstractClass2 ac = new MyAbstractClass2(); 
14           System.out.println(ac.compute()); 
15       } 
16    
17       private static class MyAbstractClass2 extends AbstractClass2 { 
18           public Object compute() { 
19               return "HelloWorld"; 
20           } 
21       } 
22   } 
23