Using class for method? It's like static, public, private? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Using class for method? It's like static, public, private?

example "class Garden", method "Garden ()"

10th Mar 2017, 10:42 PM
Alvin Fadli
Alvin Fadli - avatar
1 Answer
+ 1
that method would be called the constructor. they are public. they are called when you create an object of that class, only called once per object
11th Mar 2017, 5:49 AM
Michael Szczepanski
Michael Szczepanski - avatar