Access modifiers on classes | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Access modifiers on classes

I've been wathcing few tutorials about C# and I saw few people declaring classes with public keyword. I think that any class is declared as public by default and there is no point to write it, since there's nothing else to write (I think, correct me if I'm wrong!). protection level of methods, fields, properties etc. makes a difference and are declared as private by defauld (this I understand). But how about classes do they need to have (in some sircumstances) access modifier written near them? Or is it only for aesthetics?

28th Nov 2017, 8:25 PM
Jacob “uhgfel” L
Jacob “uhgfel” L - avatar
0 Answers