Does Constructor has return type | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Does Constructor has return type

28th Aug 2016, 4:24 PM
Sárávánán Srinivásán
Sárávánán Srinivásán - avatar
5 Answers
0
no constructor does not have a return type,not even void
28th Aug 2016, 5:13 PM
Jaffar Sadhik
Jaffar Sadhik - avatar
0
no constructor ll not have any return type instead it ll hold the current object address in d form of reference variable
28th Aug 2016, 6:02 PM
bhavya
0
no constructor does not have any return type, it is a special type member function, that called on object creation time
29th Aug 2016, 4:30 AM
Pradeep Saini
Pradeep Saini - avatar
0
constructer doesn't have return type, only methods have return types
30th Aug 2016, 6:26 PM
SHRIDHAR M PATIL
- 1
Actually, constructor returns the created object. This allows you to write something along these lines: new A().method(); or pass it into a method like this: System.out.println(new A());
29th Aug 2016, 8:51 AM
Miro Jäntti
Miro Jäntti - avatar