Method and Property
1. How is method overriding different from method overloading?
When overriding a method, you alter the behavior of the method for the derived class. Overloading a method basically involves having another method with the same name within the class.
2. 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).
3. What are the different ways a method can be overloaded?
Different parameter information types, different number of parameters, different order of parameters.
4. If a base class has a number of overloaded constructors, and an inheriting class has a number of overloaded constructors; can you enforce a call from an inherited constructor to a specific base constructor?
Yes, the place of two points, and then keyword base (parameter list to invoke the appropriate constructor) in the overloaded constructor definition inside the inherited class.
Events and Delegates
1. What’s a delegate?
A delegate object encapsulates a reference to a technique.
2. What’s a multicast delegate?
A delegate that has multiple handlers assigned to it. Each assigned handler (process) is called.
Debugging and Testing
3. What debugging tools come with the .NET SDK?
Cordbg - command-line debugger. Cordbg To use, you must compile the original C # using the / debug.
2. DbgCLR - graphic debugger. Visual Studio. NET uses the DbgCLR.
4. What does assert() method do?
In debug compilation, assert themselves in a Boolean condition as a parameter, and displays the error dialog if the condition is false. The program continues without interruption if the condition is true.
5. What’s the difference between the Debug class and Trace class?
Documentation looks the same. Use Debug class for debug, use Trace class for debug and release builds.
6. Why are there five tracing levels in System.Diagnostics.TraceSwitcher?
The tracing dumps can be verbose. For applications that are constantly jogging you run the risk of overloading the machine and the hard drive. Two levels range from None to Verbose, allowing you to adjust the tracing activities.
7. Where is the output of TextWriterTraceListener redirected?
To the Console or a text file depending on the parameter passed to the constructor.
8. How do you debug an ASP.NET Web application?
Attach the aspnet_wp.exe process to the DbgClr debugger.
9. What are three test cases you should go through in unit testing?
1. Positive check cases (correct information, correct output).
2. Negative check cases (broken or missing information, proper handling).
3. Exception check cases (exceptions are thrown and caught properly).