Did constructor have return type? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5

Did constructor have return type?

16th Jan 2017, 2:18 PM
Aniket Patil
Aniket Patil - avatar
5 Answers
+ 4
During specifying any constructor I mean when we use or call a constructor we don't specify any return type but actually every constructor implicitly returns object of the class or the index of the object as in java. So according to me constructor must have a return type which we don't know I mean it implicitly returns something without any specification of return type.(as in C main indicates void main)
17th Jan 2017, 12:33 PM
N.Neeharika Reddy
N.Neeharika Reddy - avatar
+ 2
ty
16th Jan 2017, 2:22 PM
Aniket Patil
Aniket Patil - avatar
+ 1
in c ++ constructor does not have a return type because constructor is not associated with any return type.
1st Feb 2017, 8:57 AM
Wazed Ali Gazi
Wazed Ali Gazi - avatar
0
in C# the constructor have no return type
2nd Apr 2017, 12:30 PM
Ahmed Helal Ahmed
Ahmed Helal Ahmed - avatar
0
No
2nd Apr 2017, 8:23 PM
Antariksh
Antariksh - avatar