Why constructor have note return type in java. | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

Why constructor have note return type in java.

31st Dec 2018, 5:44 PM
Surendra Kumar
Surendra Kumar - avatar
2 Respostas
0
Because the constructor return a pointer on the object. That's with that pointer you can call class' methods and attributes.
31st Dec 2018, 6:09 PM
ThƩophile
ThƩophile - avatar
0
The constructor have already a return type
31st Dec 2018, 6:11 PM
ThƩophile
ThƩophile - avatar