Computer Science, asked by ahmedpumpwala, 1 year ago

difference been constructor and function

Answers

Answered by maria9
1
constructor-
1)has a name same as that of the class name.
2)does not have a return type.
3)Can be invoked implicitly at the time of object creation(default constructor).
function-
1)has a name different from that of the class name.
2)have a return type.
3)cannot be invoked implicitly. it has to be invoked only explicitly.

ahmedpumpwala: thanks a lot
maria9: welcome
Similar questions