A constructor is a special method that runs automatically when you create an instance of a class. It has the same name as the class and it can take parameter but it can not return a value..

If you don't write your own constructor, the compiler will generate a constructor for you.

If a constructor is not public, it can't be used outside of a class and it can't be called by methods that are not a part of the class.

What's the use of making a constructor private:
  1. The constructor can only be accessed from static factory method inside the class itself. Singleton can also belong to this category.
  2. A utility class, that only contains static methods.

Overloading Constructors
You can overload constructors as you can overload any method.