HI
Any one tell me with example is our class is by default private or public....?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Jun 29, 2011, 8:50 AM
class MyClass // internal, so only visible to code within same assembly
{
class MyNestedClass // private, so only visible to code within MyClass
{
}
}
Sam HobbsPosted Jun 29, 2011, 8:56 PM
Types declared in compilation units or namespaces .... default to internal declared accessibility.
Which is the same as what Vulpes said. It also says much more in case you want to try to read it. There is even sample code there.
You might want to start with "8.7 Classes"; it has some useful sample code.
VulpesPosted Jun 29, 2011, 1:22 PM
However, nested classes can be public, internal, protected internal, protected or private in C#.
Suthish NairPosted Jun 29, 2011, 11:06 AM
Suthish NairPosted Jun 29, 2011, 11:05 AM