Congratulations to all the winners of April 2013, they have won INR 3400 cash and INR 20147 worth prizes !
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 775 |  Welcome, Guest!   Register  Login
 Home > Interview Questions > C# Interview Questions > Can we make a class private in namespace ...

Can we make a class private in namespace?

Interview question and answer by: Rajni.Shekhar | Posted on: 4/3/2012 | Category: C# Interview questions | Views: 1131 | | Points: 40


Answer:

No we can not create a class private in namespace. because namespace elements can not be private, protected or protected internal.

If you will create it, compiler will trow compile time error.
Example:

namespace TestNamespace{

private class testClass{
}
}

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

Asked In: Many Interviews | Alert Moderator 
Found interesting? Add this to:


 Responses

Posted by: Akiii | Posted on: 04 Apr 2012 09:22:15 AM | Points: 10 | Alert Moderator 

Nice question rajani ..


Thanks and Regards
Akiii

>> Write Response - Respond to this post and get points

Even more ... | Submit Interview Questions and win prizes!

More Interview Questions from Rajni.Shekhar

Even more ... | Submit Interview Questions and win prizes!


About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/19/2013 11:36:16 AM