Blog Authors Posts by Ganesh .

Ganesh .

7 POSTS 0 COMMENTS

Thread States In Java

As we already know, multithreading is the most important aspect of the Java. Every Java program runs in a single thread called ‘main’ thread. From within this main thread, multiple threads are spawned and each executes concurrently and each thread will have its own stack. A thread will undergo various stages during its lifecycle. In this article, we’ll discuss...

Uses Of Synchronized Keyword In Java

Concurrency problems are most common problems among multi-threaded applications. If one single thread is executing, it can gracefully get access to the resources and complete its execution. The problem arises when multiple threads competing with each other to get hold of resources. Due to this variety of problems can occur like inconsistent data, dead lock situations etc. Java mitigates...

Java ClassLoaders

The Java ClassLoader is integral part of Java Virtual Machine (JVM), and is responsible for finding and loading class files during runtime. We can also create our own custom class loader to extend the functionality of JVM. In this article, we’ll discuss about class loaders, how they work and the methods invoked during class loading process. What is a ClassLoader In...

Importance Of Overriding Equals And Hashcode Methods

In Java everything is an Object. Every class extends from class Object implicitly. The equals() and hashCode() are methods of Object class. These two methods works in conjunction with each other. The following sections explain why these methods needs to overridden and the effects of not overriding. Override equals() method The equals() method is used to compare two objects and returns...

Implementing Threads in Java

Before we get into thread implementation in Java, let us spend some time and understand the idea and concepts behind threads and concurrent programming. What is Concurrency Applications are expected to do more than one task at the same time in parallel. Applications which do more than one tasks at a time are called concurrent applications. An example of such concurrent...

Enumerated Data Types In Java

Enumerated data types (or enums for short) are newly introduced in Java 5.0. Enums will let us choose a value from a pre-defined list of values. Each value in this pre-defined list are called “enums”. Using enums we can restrict the values thus by reducing bugs in our code. Suppose, if we are developing payroll application, we need to have...

Covariant Return Types In Java

As we already know what method overriding is, the subclass providing new implementation of the super class method provided that the method signature in subclass should exactly match with method signature of super class including the return types. The covariant return types are newly introduced since Java 5.0, and used during method overriding. Covariant return type allows us to change...

Please wait...