1
public class client
2
}
调用这访问类2
这个例子意在说明类的形成过程:
static fields ----->static method-------->constructor method -------->others
由此可见,在我们调用 getProduct 的时候,构造函数还没有执行,所以conn 对象还没有被初始化.
这个例子意在说明类的形成过程:
static fields ----->static method-------->constructor method -------->others
由此可见,在我们调用 getProduct 的时候,构造函数还没有执行,所以conn 对象还没有被初始化.
相关文章: