Pergunta de entrevista da empresa Morgan Stanley

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

Respostas da entrevista

Sigiloso

9 de jan. de 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

Sigiloso

8 de mai. de 2011

When the class is first referenced

1