Introduction We 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 and run inside the browser’s Java Virtual Machine (JVM). The mechanism that enabled such dynamic loading is a class loader. Class loaders are responsible for determining when and how classes can be…
ContinueTag: Java FAQs
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 illegal argument. Applications can sometimes handle or recover from this Throwable category or at least catch it at the Thread’s run() method, log the complaint, and continue running. Checked Exception…
ContinueCan We Override Static Method in Java?
We will discuss here whether we can override static method in Java or not.
ContinueWhat 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.
ContinueWhat 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.
ContinueLocal 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 regex pattern or regular expression.
ContinueWhat 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.
ContinueWrapper 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 store.
ContinueImprovements to HashMap in Java 8
In this post we will tell the number of improvements made to HashMap in Java 8. In other words we are going to discuss what are the improvements made to HashMap in Java 8.
ContinueWhat 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.
Continue