- What is a delegate?
Answer: A delegate is a type-safe method reference. It can be used to execute any method with a matching signature.
- What is an event?
Answer: An event is a field that is a delegate having the event
keyword applied. The keyword ensures that only +=
and -=
are used; this safely combines multiple delegates without replacing any existing event handlers.
- How is a base class and a derived class related?
Answer: A derived class (or subclass) is a class that inherits from a base class (or superclass).
- What is the difference between the
is
andas
operators?
Answer: The is
operator returns true
if an object can be cast to the type. The as
operator returns a reference if an object can be cast to the type; otherwise, it returns null
.
- Which keyword is used to prevent a class from being derived from, or a method from being overridden?
Answer:sealed
.
Find more information on the sealed
keyword at: https://msdn.microsoft.com/en-us/library...