New course! Every coder should learn Generative AI!
Try a free lesson0
what is constructor
2 Answers
+ 9
A function that gets triggered when an object is created (and belongs to the class)
+ 4
A constructor is a main method or function which is called with a class to initializate objects