Interview Questions

JSP Interview Questions and Answers

JSP interview questions are very important if you are going for a Java interview. JSP is an integral part of any Java EE web application and recently I have written a lot about different features….

Servlet Interview Questions

50 Servlet Interview Questions and Answers

Servlets is a very important topic of Java EE and all of the web applications frameworks such as Spring and Struts is built on top of it. This makes servlet interview questions a hot topic….

Java Collections Interview Questions

40 Java Collections Interview Questions and Answers

Java Collections Framework is one of the core APIs of java programming language. It’s one of the important topics for java interview questions. Here I am listing some important java collections interview questions and answers….

Java String Interview Questions and Answers

String is one of the most widely used Java Class. Here I am listing some important Java String Interview Questions and Answers. This will be very helpful to get complete knowledge of String and tackle….

Java Multithreading Interview

Java Multithreading Concurrency Interview Questions and Answers

Today we will go through Java Multithreading Interview Questions and Answers. We will also look into Concurrency interview questions and answers because both multithreading and concurrency go hand in hand. Thread is one of the….

String vs StringBuffer vs StringBuilder

Today we will look into the difference between String vs StringBuffer vs StringBuilder. StringBuffer vs StringBuilder is a popular java interview question. String vs StringBuffer vs StringBuilder String is one of the most widely used….

Java Programming Interview Questions

Java Programming Interview Questions

Recently I am taking a lot of interview for my organization. So I was in the search of some java programming test questions that are little bit tricky also.

Here I am providing five of the tricky questions I found interesting and need a closer look to understand. The explanation will be provided after the questions. Test your knowledge of java by trying to provide the answer of the below test questions.

Java Classloader

Java ClassLoader

The Java ClassLoader is one of the crucial but rarely used components of Java in Project Development. Personally I have never extended ClassLoader in any of my projects but the idea of having my own ClassLoader that can customize the Java Class Loading thrills me.

This article will provide an overview of Java Class Loading and then move forward to create a custom ClassLoader and use it.
What is a ClassLoader?

We know that Java Program runs on Java Virtual Machine (JVM). When we compile a Java Class, it transforms it in the form of bytecode that is platform and machine independent compiled program and store it as a .class file. After that when we try to use a Class, Java ClassLoader loads that class into memory.

There are three types of built-in Class Loaders in Java:

1. Bootstrap Class Loader – It loads JDK internal classes, typically loads rt.jar and other core classes for example java.lang.* package classes
2. Extensions Class Loader – It loads classes from the JDK extensions directory, usually $JAVA_HOME/lib/ext directory.
3. System Class Loader – It loads classes from the current classpath that can be set while invoking a program using -cp or -classpath command line options.

Java Class Loaders are hierarchical and whenever a request is raised to load a class, it delegates it to its parent and in this way uniqueness is maintained in the runtime environment. If the parent class loader doesn’t find the class then the class loader itself tries to load the class.

Generic selectors
Exact matches only
Search in title
Search in content
Search in posts
Search in pages