Sollicitatievraag bij Morgan Stanley

When does a java static class get loaded/intialized by jvm?

Antwoorden op sollicitatievragen

Anoniem

9 jan 2017

A Java static class is loaded by jvm when anyone of the following occurs : 1. A non constant static field is used 2. A static field is assigned 3. A static method of the class is invoked 4. An instance of the class is created In nutshell, we can say when enclosing Java class is used for the first time.

2

Anoniem

8 mei 2011

When the class is first referenced

1