第一个例子:

public class StaticDemo {
    {
        System.out.println("{} 代码块");
    }
    static{
        System.out.println("static 代码块");
    }
    
    public static void main(String[] args) {
        
    }

}
static 代码块
View Code

相关文章:

  • 2021-07-29
  • 2022-12-23
  • 2022-12-23
  • 2021-04-21
  • 2022-12-23
  • 2021-10-06
  • 2021-05-31
  • 2022-12-23
猜你喜欢
  • 2021-06-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-28
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案