您的位置:首页 > Web前端 > JavaScript

json 对象和字符串(string)的转换

2012-02-21 15:25 316 查看
/**
 * 构造方法是  是被实例化的时候才调用的
 * 继承父类  等于实例化父类
 * @author zx
 *
 */
public class A {
 public A(){
  System.out.println("------A-------");
 }
 public static void main(String[] args) {
  new Child();
       //  System.out.println(new Child());  
     }
 
}
class Parent {  
    public  Parent() {  
        System.out.println("----Parent----");  
    }  
}  
class Child extends Parent {  
    public Child() {  
        System.out.println("----Child-----");  
    }  
    Brother b = new Brother();  
}  
 class Brother {  
    public Brother(){  
        System.out.println("----Brother----");  
    }  
}  

运行结果:

----Parent----
----Brother----
----Child-----
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: