The rules of the AVA field initialization : The default value specified when executing a class member definition, or the initialization block of the class, who executed it before, and the initialization block of the class does not receive any arguments, and is executed when the object of the class is created.
How do I access an instance member of a class in a static method?
A static method or property in a class is not inherently a member of the class, and when the Java virtual machine is loaded into the class, the static objects already have the object, and it is only in this class that " Aliens " , you do not need to instantiate through the class's constructor (constructor) class, rather than a static property or method, where the class's load does not exist, and you need to rely on the instance object of the class to exist after executing the class's constructor. So when a non-static method is called in a static method, the compiler will error (cannot make a static reference to the Non-static method func () from the type a ).
03 Classroom Questions