It is not used before, it is defined. The destination may be on the line above in the source, but it doesnβt matter - javac reads the entire source file and then starts generating the code. (The way he can define things like "a personal variable is never used", etc.). In other words, the order of the statements is important to determine which operators in the sequence are executed first, but the neighboring elements of the class do not have an βorderβ of this kind among them.
However, there are rules for static / non-static elements, and they guarantee that this value will be available after loading the classes and before creating the object.
source share