What is difference between java.lang .Class and java.lang.ClassLoader? What is the hierarchy of ClassLoader

Showing Answers 1 - 3 of 3 Answers

Sarva Rayudu

  • Oct 31st, 2005
 

A Class is nothing but a byte code which will be generated when you compile a java file. And it is required to execute your java file.  Where as a ClassLoader is also a class which loads the class files into memory in order for the Java programs to execute properly. The hierarchy of ClassLoaders is:

  1. Bootstrap ClassLoaders
  2. Extensive ClassLoaders
  3. System Classpath ClassLoaders
  4. Application ClassLoaders or (EAR ClassLoaders)
  5. EJB ClassLoaders or (JAR ClassLoaders)
  6. WAR ClassLoaders.

Sarva Rayudu

  • Oct 31st, 2005
 

The hierarchy of ClassLoaders is:

  1. Bootstrap ClassLoaders
  2. Extensive ClassLoaders
  3. System-classpath ClassLoaders
  4. Application ClassLoaders or (EAR ClassLoaders)
  5. EJB ClassLoaders or (JAR ClassLoaders)
  6. WARClassLoaders.

  Was this answer useful?  Yes

mandyjoshi

  • Nov 11th, 2005
 

Class 'java.lang.Class' represent classes and interfaces in a running Java application. JVM construct 'Class' object when class in loaded. Even primitive data types have 'Class' object.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions