Why Can You Instantiate a Class within its Definition?

前端 未结 9 1817
无人共我
无人共我 2020-12-24 13:22

A coworker (who is very new to Java) stopped in today and asked what seemed like a very simple question. Unfortunately, I did an absolutely horrible job of trying to explain

9条回答
  •  离开以前
    2020-12-24 13:59

    The jvm loads the class whenever it is first "mentioned". Then there is nothing to prevent instantiation - it is already loaded

提交回复
热议问题