0
Why we create constructor in classes
What is the use of constructor or why we need it
6 ответов
+ 3
Constructor is called everytime you create an object of its class. You can use it for example to set default values of object properties.
+ 3
Exactly
+ 2
Aleksander Szczepura
So it is called automatically when you create its object p=Person("jack")
And you passed the name in it we dont need to call it like other methods
0
Aleksander Szczepura can you define it with example
0
Thanks bro