Core Java Interview Questions-Constructors

This Core Java Interview Questions-Constructor page provides all the interview questions on java constructors including definitions, need of constructor, default constructor, arguments constructor and many more interview questions with suitable answers.


What is a constructor?
A special java method having the same name of the class.


Does return type allowed in the constructor?
No, but it returns implicitly object address.


What is the use of constructor?
It used to initialize object..


When do we call the constructor?
In the process of object creation.


What is Default constructor?
Compiler supply a “zero arguments constructor with the empty body” is called the default constructor.


Can we define arguments constructor?
Yes allowed.


Will compiler add default constructor if we define arguments constructor?
No, the compiler adds only when we don’t define any constructor.


Can we define more than one constructor in the same class?
Yes allowed but with the different signature.


>Core Java Interview Questions-Access Modifiers<

Share this