0

Do Constructors have a return value ??

3rd Jan 2020, 10:58 AM
Andrew Sameh
Andrew Sameh - avatar
2 Answers
+ 4
When you create an object It's the "new" keyword that returns a refrenece to that object
3rd Jan 2020, 11:27 AM
D_Stark
D_Stark - avatar
+ 1
No they do not. Constructors do not return anything. You might sometimes be confused with methods since they have a return type and they can have the same name as the class name and also the constructor is declared using the class name.
3rd Jan 2020, 11:06 AM
Avinesh
Avinesh - avatar