+ 3

what is constructor explain briefly?

what is constructor explain briefly?

11th Apr 2019, 10:16 AM
deepak sharma
deepak sharma - avatar
2 Answers
+ 3
Basically the code inside the constructor gets run when a new object is created (in case u want some initial value). Little code example below: https://code.sololearn.com/c8BqR7GNEd26/?ref=app
11th Apr 2019, 11:11 AM
winterbreeze
winterbreeze - avatar