menu
techminis

A naukri.com initiative

google-web-stories
Home

>

Programming News

>

Inside the...
source image

Medium

1w

read

228

img
dot

Image Credit: Medium

Inside the JVM: How Java Loads Classes and Creates Objects

  • The blog delves into how Java loads classes and creates objects inside the JVM, focusing on the processes involved.
  • Java performs lazy class loading in the JVM, with triggers causing classes to be loaded when needed.
  • The class loader locates and loads .class files into the method area of the JVM.
  • Java ClassLoader subsystem follows a parent delegation model for secure and consistent loading.
  • After loading into memory, classes undergo essential steps before being ready for use.
  • Object creation in Java involves mechanisms like new keyword and cloning.
  • During object creation, memory is allocated in the heap for all instance members.
  • Constructor invocation involves stack frame allocation, assigning arguments, and superclass constructor chain.
  • Instance initializers and variable initializers are copied into constructors for proper initialization.
  • The JVM returns the reference of the newly created object after constructor execution.

Read Full Article

like

13 Likes

For uninterrupted reading, download the app