Meet Patel

I am a passionate programmer, blogger, and developer by choice. I like to write and contribute to the developer community.

Singleton Class and Private Constructor in Java : Free Java Tutorials

For any Java class, if we are allowed to create only one object, then such type of class is called a singleton class. For example, Runtime and ServiceLocator are singleton classes. We can implement a Singleton class using a private constructor. The advantage of Singleton class: Memory utilization and Performance improvement If several people have …

Singleton Class and Private Constructor in Java : Free Java Tutorials Read More »

Overloaded Constructors in Java : Free Java Tutorials

Overloaded constructors exist in Java. Within a class, we can declare multiple constructors. All these constructors are having the same name but different type of arguments. Hence, all these constructors are considered overloaded constructors. Hence, overloading concept is applicable to constructors. Example of Overloaded Constructors // Demo class class Demo { // defining three overloaded …

Overloaded Constructors in Java : Free Java Tutorials Read More »

Default Constructor in Java : Free Java Tutorial

A default constructor is automatically generated when the programmer has not specified any constructors explicitly. The compiler is responsible to generate default constructor but not JVM. Also, the compiler will generate default constructor if and only if the class does not contain a constructor. If there is at least one constructor inside the class, then …

Default Constructor in Java : Free Java Tutorial Read More »

Control Flow Mechanisms and Object Creation in Java : Free Java Tutorials

Instance Control Flow and Static Control Flow are both very important control mechanisms in Java. We know that first Static Control Flow takes place and only after an Object Creation, Instance Control Flow takes place. In this tutorial, we will understand how both control mechanisms work simultaneously through an example. // Main Class public class Demo …

Control Flow Mechanisms and Object Creation in Java : Free Java Tutorials Read More »