Computer Applications
What is not true for a constructor?
- It is used only to initialize the data members.
- It returns a unique value.
- It may not use parameter.
- None of the above.
Java Constructors
20 Likes
Answer
It returns a unique value.
Reason — A constructor has no return type as it doesn't return any value.
Answered By
13 Likes
Related Questions
A constructor is always:
- private
- protected
- secure
- public
Which constructor initialises data members with default values?
- Parameterized constructor
- Non-parameterized constructor
- Copy constructor
- Default constructor
Fill in the blanks:
A member function having the same name as that of the class name is called _________.
Fill in the blanks:
A constructor has return _________ type.