Computer Applications
What is a constructor ? What does it do ?
Java Constructors
14 Likes
Answer
A constructor is a member function with the same name as that of its class but no return type.
A constructor is used to initialize the objects of that class type with legal initial values.
Answered By
9 Likes
Related Questions
Fill in the blanks:
The keyword _________ refers to current object.
Or
Name the Java keyword that stores the address of the currently-calling object — _________.
Fill in the blanks:
Many constructor definitions in the same class is known as constructor _________.
What is that class called which does not have a public constructor ?
When is a constructor automatically invoked ?