java 继承

 1 public class TopicOne {
 2     
 3     public static void main(String[] args) {
 4         B b = new B();
 5     }
 6 }
 7 
 8 class A{
 9     C c = new C();
10     public A(){
11         System.out.println("A");
12     }
13 }
14 
15 class B extends A{
16     C c = new C();
17     public B(){
18         System.out.println("B");
19     }
20 }
21 
22 class C{
23     public C(){
24         System.out.println("C");
25     }
26 }

 

posted @ 2014-10-15 21:11  soul390  阅读(110)  评论(0编辑  收藏  举报