98-361 MTA Software Development
Fundamentals
What is the Main method? - ✔✔It serves as the entry point to a program. When runtime
executes a program, it always starts at the Main method.
What does the Switch statemen
...
98-361 MTA Software Development
Fundamentals
What is the Main method? - ✔✔It serves as the entry point to a program. When runtime
executes a program, it always starts at the Main method.
What does the Switch statement do? - ✔✔It works like CASE, and allows for different
options to run different code, which uncomplicates having to combine several if
statements.
Name the 4 C# control structures. - ✔✔while loop, do-while loop, for loop and foreach
loop
When does the do-while loop test the condition? - ✔✔At the bottom of the loop.
What is the foreach loop useful for? - ✔✔Iterating through elements of a collection or
array.
What is recursion? - ✔✔A programming technique that causes a method to call itself in
order to compute a result.
How to you use a try-catch block? - ✔✔Put the code that could throw an exception in
the try section, and place the code that catches exceptions in the catch section.
What is the finally block used for? - ✔✔It is always executed regardless of whether an
exception has been thrown, so you can put clean up code here such as disconnections.
What is a Class? - ✔✔The template from which individual objects are created.
What is a delegate? - ✔✔- Special type that is used to encapsulate a method with a
specific signature.
- Holds the method(s) reference in an object.
- Referred to as a type safe function pointer.
Properties are often referred to as "_____" fields because they can include code for
checking data consistency or validity. - ✔✔Smart
A property has two _________ - ✔✔Accessors, GET and SET
Properties are often assigned with a ______ access modifier - ✔✔PublicThe usual programming pattern is that all the data fields of a class should be declared
private, - ✔✔and that access to these private fields should be via public properties that
check the data values for validity
How do you make a read-only property accessor? - ✔✔Don't put in the set accessor
What is an auto-implemented property? - ✔✔The simplified syntax for a property
declaration, for example: public double length { get; set; }
What does the THIS keyword do? - ✔✔It is used to access members from within
constructors, methods and accessors of instance properties, which provides more
flexibility in naming the method parameters
Among many other applications, delegates form the basis for _______ - ✔✔event
declarations
Events are a way for a class to notify other classes or objects when something of
interest happens. - ✔✔The class that sends the notification is called the publisher of the
event, the class that receives the notification is called the subscriber.
2 pieces of information are needed to define an event: - ✔✔1. A delegate that connects
the event with its handler methods
2. A class that contains the event data. This class is usually derived from the EventArgs
class
How is the EventHandler delegate defined? - ✔✔public delegate void
EventHandler(Object sender, Eventargs e);
The EventArgs class is - ✔✔used by events that do not pass any event-related
information to an event handler.
[Show More]