C# (pronounced C-sharp) is a new object oriented language from Microsoft and is derived from C and C++. It also borrows a lot of concepts from Java too including garbage collection.
C Sharp Interviews are getting tough these days as the technology grows faster. To get through the C Sharp interview one needs to update him/herself in a regular manner. Having said that, just before the interview, it is very important to have a quick glance of the reputed C Sharp questions and answers to make yourself comfortable during the interview process. This is where DoAnswers.com helps you in renewing yourself on C Sharp and various other technologies interview preparation.
1. Are private class-level variables inherited?
Yes, but they are not accessible. Although they are not visible or accessible via the class interface, they are inherited.
2. Can multiple catch blocks be executed for a single try statement?
No. Once the proper catch block processed, control is transferred to the finally block (if there are any).
3. Can you allow a class to be inherited, but prevent the method from being over-ridden?
Yes. Just leave the class public and make the method sealed.
4. Can you declare an override method to be static if the original method is not static?
No. The signature of the virtual method must remain the same. (Note: Only the keyword virtual is changed to keyword override)
5. Can you inherit multiple interfaces?
Yes. .NET does support multiple interfaces.
6. Can you prevent your class from being inherited by another class?
Yes. The keyword ?sealed? will prevent the class from being inherited.
7. Can you store multiple data types in System.Array?
No.
8. Describe the accessibility modifier ?protected internal?.
It is available to classes that are within the same assembly and derived from the specified base class.
9. Does C# support multiple-inheritance?
No.
10. Explain the three services model commonly know as a three-tier application.
Presentation (UI), Business (logic and underlying code) and Data (from storage or other sources).