0
What differentiates static variables from local variables and instance variables?
2 odpowiedzi
0
Different in scope of visibility, initialization order and lifetime.
Static variable is available for the entire class and his descendants and is one for all of them. But for static methods. Exists always.
Instance var visible for entire class for all his methods. Exists until class instance exists.
Local var visible and available only in the border of his method. Exists to the end of method.
Initialization order:
static
instance
local
0
Thank you.