can we declare private class in namespace?

 Posted by Rajni.Shekhar on 4/11/2012 | Category: ASP.NET Interview questions | Views: 1734 | Points: 40
Answer:

No we can declare private class in namespace, it will give compile time error.

Example:

namespace example
{
private class ex //error
{
}
}

"Error: Elements defined in a namespace cannot be explicitly declared as private, protected, or protected internal"


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response