- Juxtapose the use of override with new. What is shadowing?
- Override redefines an inherited method which was marked as virtual or abstract,and its access level must be the same as the method it overrides. New allows you to completely hide an inherited member and create a different implementation of it with whatever attributes you choose. Shadowing is another name for disabling an inherited method and redefining it.
- Explain the use of virtual, sealed, override, and abstract.
- Virtual marks a method as overridable. Sealed marks a class as uninheritable. Override redefines a method declared as virtual. Abstract defines a class which cannot be instantiated, or a method which must be overriden in any derivedclasses.
- Explain the importance and use of each component of this string: Foo.Bar,Version=2.0.205.0, Culture=neutral, PublicKeyToken=593777ae2d274679d
- Assemblyname -- used for loading. Assembly version -- also used for loading.Culture -- defines culture settings used for string translation andother locale-specific settings. PublicKeyToken -- used to uniquely identifythis assembly and prevent collisions.
- Explain the differences between public, protected, private and internal.
- Public:accessible from any class. Private: accessible only from within the same class. Protected: like private, but derived classes may also access. Internal:like public, but accessible only by code within the same assembly.
- What benefit do you get from using a Primary Interop Assembly (PIA)?
- APIA is a strongly-named assembly which defines COM interfaces for a component.Because it is strongly-named, it can be loaded into the GAC and verified against the COM component's own signature to give the component collision-protection and authorship-verification benefits when interacing with .NET code.
- By what mechanism does NUnit know what methods to test?
- Readingattributes defined for classes and methods via reflection.
- What is the difference between: catch(Exception e){throw e;} and catch(Exceptione){throw;}
- Both statements will catch and throw exception, butthe latter will preserve the original exception stack.
- What is the difference between typeof(foo) and myFoo.GetType()?
- The first returns the object's type at compile time; the second returns itat runtime.
- Explain what’s happening in the first constructor:public class c{ public c(string a) : this() {;}; public c() {;} } How is this construct useful?
- The first constructor invokes the base constructor in addition to its own functionality; this wouldbe useful if your base initialized basic field values or had other code that all other constructors would utilize.
- What is this? Can this be used within a static method?
- The "this" reference refers to the current object context. Static methods have no context,so it is not valid.
Wednesday, October 12, 2005
Questions for C# Component Developers
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment