zoukankan      html  css  js  c++  java
  • Java--类初始化

     1 package httpclient.demo;
     2 
     3 public class StaticTest {
     4 
     5     public static void main(String[] args) {
     6 
     7         staticFunection();
     8     }
     9 
    10     static StaticTest st = new StaticTest();
    11 
    12     static {
    13         System.out.println("1");
    14     }
    15 
    16     {
    17         System.out.println("2");
    18     }
    19 
    20     public StaticTest() {
    21         // TODO Auto-generated constructor stub
    22         System.out.println("3");
    23         System.out.println("a =" + a + ", b=" + b);
    24     }
    25 
    26     public static void staticFunection() {
    27         System.out.println("4");
    28     }
    29 
    30     int a = 110;
    31     static int b = 112;
    32 
    33 }

  • 相关阅读:
    CF258D
    CF662C
    CF1295F
    CF1406E
    CF1270F
    CF1278F
    CF1523E
    CF1554E
    算法第四章上机实践报告
    LCA RMQ+ST表学习笔记
  • 原文地址:https://www.cnblogs.com/microcat/p/6524458.html
Copyright © 2011-2022 走看看