Understanding Java Class Loaders

Java Class Loaders You will see here what are the Java class loaders with simple example. Java publicly released in the year of 1995 with a web browser with the ability to automatically and dynamically download applets whenever it encounters <Applet> tag in the HTML document. Such Applets are loaded on the fly across the network from remote web servers…

Exception vs Error in Java

I will tell you here what are the differences between Exception and Error in Java. There are mainly three important categories of Throwable: Error – something severe enough has gone wrong the most applications should crash rather than try to handle the problem. Unchecked Exception (also known as, RuntimeException) – mainly a programming error, such as, a NullPointerException or an…

Can We Override Static Method in Java?

We will discuss here whether we can override static method in Java or not.

What is Class.forName() in Java

The Class.forName() in Java or java.lang.Class.forName(String className) method returns the Class object associated with the class or interface with the given string name.

What is the purpose of garbage collection in Java?

The purpose of garbage collection in Java is to identify and discard objects that are no longer needed by a program so that their resources can be reclaimed and reused later.

Local Class in Java

Local class or classes in Java are defined in a block, which is a group of zero or more statements between balanced braces. We typically find local classes defined in the body of a method. We can define a local class in Java inside any block. In this example we will create a local class to validate email address using…

What is static import in Java?

We will discuss about static import in Java. The static import construct allows unqualified access to static members without inheriting from the type containing the static members. Instead, the program imports the members, either individually: or all at once from a particular package.

Wrapper Class in Java

I will tell you here what is wrapper class in Java. The primitive data types are not objects; so they do not belong to any class; they are defined in the language itself. Sometimes, it is required to convert data type into an object in Java language. For example, up to JDK 1.4, the data structure accepts only objects to…

Improvements To HashMap In Java 8

Improvements To Java HashMap In this post I will tell you the number of improvements made to HashMap in Java 8 or later version. In other words I am going to discuss what are the improvements made to HashMap in Java 8 version.

What is strictfp keyword in Java?

We will discuss about strictfp keyword in Java. strictfp is a keyword in the Java programming language that restricts floating-point calculations to ensure portability. The strictfp was introduced into Java with the Java virtual machine (JVM) version 1.2 and is available for use on all currently updated Java VMs.