lass Zi
{
//静态代码块
static
{
System.out.println("zi 静态代码块");
}
//构造代码块
{
System.out.println("zi 构造代码块");
}
public Zi()
{
System.out.println("zi 构造方法");
}
}
class BlockCodeDemo
{
public static void main(String[] args)
{
Zi z = new Zi();
Zi z2 = new Zi();
}
} |
|