What is Constructor in Java

A constructor is a special block of code in Java that is automatically invoked when you create an object using the new keyword.