I was currently learning more about constructors in Java, and I found out that just like the __init__ function in Python, constructors are functions that are called as soon as we instantiate an object of a class.
So, are both the concepts one and the same, abstractly?
These are very similar things, however with at least one big difference.
__init__ is called after the object has been constructed, so you have a valid reference to it (called self)If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With