类私有构造函数时初始化的进行

public class Log{

    private int count;

   static{
        setCount( 1 );  //通过static构造程序块进行初始化,与匿名类的初始化一样.
    }

  private Log(){
    
  }
 
 public setCount( int count ){
    this.count = count;
}
}

注:
   static{
        setCount( 1 );  //通过static构造程序块进行初始化,与匿名类的初始化一样.
        System.out.println( "initialization...' );
        System.exit(0);  //即使没有main函数也能执行
    }