java - Question about static member variables -


in following code, assumption member variable mbar instantiated upon first construction of foo object... , mbar instantiation shared future foo objects, bar() constructor not called again. accurate?

public class foo {   private static bar mbar = new bar();    public foo() {    } 

the object might constructed way before creation of first foo.. executed when classloader loads foo.class in memory , can happen pretty @ time.... when load other classes use foo class, or when call static method of class....


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -