Q.

What is the return type of Constructors?

A. int
B. float
C. void
D. None of the mentioned
Answer» D. None of the mentioned
877
0
Do you find this helpful?
7

View all MCQs in

Java Programming

Discussion

Shubhu Kr
4 months ago

Ans is (c). Void, Constructors don't have a return type explicitly specified in their declaration. They are called implicitly when an object of a class is created, and their purpose is to initialize the object. Therefore, they do not return any value explicitly, and the return type is implicitly considered as void.
1

Amit Pachange
4 months ago

Answer should be D. Because constructors are not considered to be method, It's more like special method without return type. Also constructor implicite return type is class itself (instance of class) not even void. They are not meant to return anything
2