When you want to initialize fields while creating object then we can go for constructor, normally the constructor will be invoked by the new operator after the memory is allocated for the new object, the constructors should have the same name as the class name
The constructor that does not take any parameters is called default constructor, if we don’t provide any constructor to the class then the default constructor will execute, the default constructor will be executed when we create an object something like this
A technology enthusiast and a professional blogger from India. Through out my IT career, I have had the pleasure of working on various new technologies and built products like www.ziprides.com and some other products. Unfortunately, my attempts have not given me the desired results and as a result, I have finally decided to build a professional blog where I would like to share all my learnings and hoping to learn from other enthusiasts around the world.