Reputation: 21286
OK, well, I am a beginner, so.. yeah, this may be a very stupid question. I read that if I declare variable or object, without mentioniong the access-modifier (public, private, etc.) than it's automatically making it having the Internal acess modifier (and it will exist anywhere in the current namespace).
So why do I need to set my vars in a class as Public to get them in another class (such as my program's class of course).
Upvotes: 0
Views: 217
Reputation: 62093
Because you can not read? Ok, joking aside. You said you are a eginner, so this is totally normal to overlook small things.
I read that if I declare variable or object, without mentioniong the access-modifier (public, private, etc.) than it's automatically making it having the Internal acess modifier
Ah, no. It defaults to private, NOT to internal. It defaults to the most sensible default, and internal would still allow a lot of cross class accesses that lead to bad code practices.
Upvotes: 5