New course! Every coder should learn Generative AI!
Try a free lesson+ 1
Don't constructors require any return types?
2 Answers
+ 2
constructors are not actually methods. most of times they are used to initialize .
they are called as soon as the class object is created.
0
No constructors don't require any return type. They are called when the object is created. Well it initialise the object. So therr won't be any return types for constructors.!