static {
name="xiaoming";
}
private static String name=null;
The code above, print out the name is null
private static String name=null;
{static
name = "xiaoming";
}
The above code, the name is printed xiaoming
static {
name="xiaoming";
}
private static String name;
The above code, the name is printed xiaoming
Thus, the variable name is first loaded, and the time of the assignment, either directly on the variable assignment or assignment in static code block, are assigned in the order code.