Revature Interview Question

What is a constructor and how is it called?

Interview Answers

Anonymous

Dec 10, 2020

Constructors are used to initialize the state of an object. It can be called with or without parameters (default constructor vs paramaterized)

3

Anonymous

Oct 2, 2021

Inn Java, a constructor is a block of codes similar to the method. It is called when an instance of the object is created, and memory is allocated for the object. It is a special type of method which is used to initialize he object.

1