java技术博客

jsp博客
数据加载中……
ConstructorTest
/**
*测试类构造器的调用顺序
*/
public class ConstructorTest{
public static void main(String[] args){
C c=new C("hello");
}
}
class A{
public A(){
System.out.println("this is A");
}
}
class C extends B{
public C(String str){
super(str);
System.out.println("this is C");
}
}

posted on 2008-10-22 13:49 郭兴华 阅读(124) 评论(0)  编辑  收藏


只有注册用户登录后才能发表评论。


网站导航: