How do we know which type of class to use? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How do we know which type of class to use?

Public, protected or private class?

15th May 2019, 1:45 PM
Msizi
1 Answer
0
If you think about what you want to do with the data you should know what type of class to use, you can take SoloLearn as an example, when you write a code it gives you the option to publish it [public], where anyone can see the code, make it private, where only you can see it, or (if we add an option) make it only visible to your followers [protected]
15th May 2019, 2:34 PM
Shzen
Shzen - avatar