About Me

All about Real time requirements in Orale Stay Tune!!

Sunday, April 6, 2008

C# INTERVIEW QUESTIONS

Will the finally block get executed if an exception has not occurred?

Yes.

What’s the C# syntax to catch any possible exception?

A catch block that catches the exception of type System.Exception. You can also omit the parameter data type in this case and just write catch {}.

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).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).

What is the syntax to inherit from a class in C#?

Place a colon and then the name of the base class.

Example: class MyNewClass : MyBaseClass.

Can you prevent your class from being inherited by another class?

Yes. The keyword “sealed” will prevent the class from being inherited.

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.

What’s an abstract class?

A class that cannot be instantiated. An abstract class is a class that must be inherited and have the methods overridden. An abstract class is essentially a blueprint for a class without any implementation.

0 comments: