What is Java Classloader?
Java Classloader is part of Java runtime environment which loads class on demand (lazy loading) into JVM (Java Virtual Machine) not only from local file system but from remote system or web.
There are 3 types of Classloader.
i. Bootstrap Classloader: Loads core java API file rt.jar from <JAVA_HOME/jre/lib> folder.
ii. Extension Classloader: Loads jar files from <JAVA_HOME/jre/lib/ext> folder.
iii. System/Application Classloader: Loads jar files from path specified in environment variable as CLASSPATH.
Is This Answer Correct ? | 3 Yes | 0 No |
What is final variable?
What is e java?
public class Garbage { int a=0; public void add() { int c=10+20; System.out.println(c); System.out.println(a); } public static void main(String args[]) { Garbage obj=new Garbage(); System.gc(); System.out.println("Garbage Collected"); obj.add(); } } Above is a code in java used for garbage collection. object obj has been created for the class Garbage and system.gc method is called. Then using that object add method is called.System.gc method if called the obj should be garbage collected?
What is the purpose of format function?
Is set thread safe java?
Can private class be inherited in java?
what are the design patterns in struts?
What is the effect of keeping a constructor private?
Can we restart a thread already started in java?
Why java is free from garbage values??
When should we create our own custom exception classes?
How many types of exception can occur in a java program?