Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Java Class Loaders - basics

 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Hi All,

I found so many posts regarding the Java Class Loaders in the forum, but nothing is there completely in the forum.
For that reason, I again started this post.

For the best of my knowledge,

Whenever a JVM is started, class loaders are responsible for loading the classes.

Three class loaders are used
1) Bootstrap class loader
2) Extensions class loader
3) System class loader

The bootstrap class loader loads the core Java libraries[5] (<JAVA_HOME>/lib directory). This class loader, which is part of the core JVM, is written in native code.

The extensions class loader loads the code in the extensions directories (<JAVA_HOME>/lib/ext or any other directory specified by the java.ext.dirs system property). It is implemented by the sun.misc.Launcher$ExtClassLoader class.

The system class loader loads code found on java.class.path, which maps to the system CLASSPATH variable. This is implemented by the sun.misc.Launcher$AppClassLoader class.

So consider I have an application of around 10 classes, which are compiled. And the path for this class files is given in the CLASSPATH variable.

So my question here is,

1) Now if the JVM is started, does all the 10 classes will be loaded in the JVM or not (at the time of starting JVM itself)?

2) COnsider all the classes are loaded. Then in one of my classes, consider a statement is there like A a = new A();
the 'new' keyword is used to instantiate the class which is already loaded in JVM right?

3) what are the phases does a class will go before execution, I mean like JSP life cycle thattranslation compilation etc. the same ways what are the phases for a class

Please reply.

Thanks & Regards,
Ravi.
 
Sheriff
Posts: 22649
126
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
After being here for three years you should know better than posting questions in multiple forums. Let's continue here.
 
My, my, aren't you a big fella. Here, have a tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
    Bookmark Topic Watch Topic
  • New Topic