When will we use class loader?

Answer Posted / aks

In a Java Virtual Machine (JVM), each and every class is
loaded by some instance of a java.lang.ClassLoader. The
ClassLoader class is located in the java.lang package and
you can extend it to add your own functionality to class
loading.

Since Java 1.2 we have three types of class loaders:
Class loaders created automatically by the JVM
Program defined class loaders
Context class loaders.

There are three Class loaders in first group:
bootstrap class loader - loads classes
from ../jre/lib/rt.jar It is the "root" in the class loader
hierarchy.
extensions class loader - loads classes
from ../jre/lib/ext/*.jar
system class loader - it is responsible for loading in the
application, as well as for loading classes and resources
in the application's CLASSPATH.

Second group includes:
system class loader - parent class loader by default
additional parent class loader can be specified explicitly

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many ways can an argument be passed to a subroutine and explain them?

584


Is special character in java?

616


What is mysql driver class name?

556


What are heterogeneous objects?

571


Explain thread in java?

664






What is the size of boolean variable?

579


Can an interface have a constructor?

518


Write a function to find out longest palindrome in a given string?

597


Explain working of call by reference function invoking.

594


What's the difference between comparison done by equals method and == operator?

548


Give differences between Quicksort &Mergesort. When should these sorts be used andwhat is their running time in java?

687


please send me hr interview questions in it industry

1672


Can you use this() and super() both in a constructor?

525


Explain polymorphism citing an example.

592


What is a java lambda expression?

561