DEVELOPMENT FUNDAMENTALS
EXAM QUESTIONS AND ANSWERS
What does the Switch statement do? - Answer-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. - Answer-while loop, do-while loop, for loop and
foreach loop
When does the do-while loop test the condition? - Answer-At the bottom of the loop.
What is the foreach loop useful for? - Answer-Iterating through elements of a
collection or array.
What is recursion? - Answer-A programming technique that causes a method to call
itself in order to compute a result.
How to you use a try-catch block? - Answer-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? - Answer-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? - Answer-The template from which individual objects are created.
What is a delegate? - Answer-A special type that is used to encapsulate a method
with a specific signature.
Properties are often referred to as "_____" fields because they can include code for
checking data consistency or validity. - Answer-Smart
A property has two _________ - Answer-Accessors, get and set
Properties are often assigned with a ______ access modifier - Answer-Public
The usual programming pattern is that all the data fields of a class should be
declared private, - Answer-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? - Answer-Don't put in the set
accessor