android static final 初始化问题

public class Test {


    static {

        Log.d("xxxxxxxxxxxxxx","1");

    }


    public static final String a = "123";

    public final static String b = getB();
    public final static String c = getC();


    private static String getB(){
        Log.d("xxxxxxxxxxxxxx","bbbbbbbbb");
        return "bb";
    }


    private static String getC(){
        Log.d("xxxxxxxxxxxxxx","ccccccccc");
        return "cc";
    }

}

android static final 初始化问题_第1张图片

你可能感兴趣的:(android static final 初始化问题)