



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




In a three-layer application, the three layers are - ANS-the presentation layer, the middle layer, and the database layer When you design and develop business classes for an application, your goal is to - ANS-allow development to be spread among members of a development team separate the business rules from the presentation and database logic make the application easier to develop and maintain (all of the above) A class defines the properties and methods of - ANS-an object The process of creating an object from a class is known as - ANS-instantiation What feature are you taking advantage of when you call the ToDecimal method of the Convert class without knowing how it's coded? - ANS-encapsulation
The fields of a class - ANS-are the variables that are defined at the class level Two objects created from the same class can have different - ANS-data A class file that you add to a project has the extension - ANS-cs To return the value of an instance variable named v from a get accessor, you code - ANS-return v; Which of the variables declared in the following class is an instance variable? public class Customer { public string firstName; private static int count; public string GetDisplayText() { string displayText = firstName + count; return displayText; } } - ANS-firstName A read-only property consists of just - ANS-a get accessor To begin the declaration for a property, you code the public keyword followed by - ANS-the data type and the name of the property You can use an auto-implemented property when - ANS-you want the get and set accessors to simply return and set the value of an instance variable
To display the location of each reference to a class or member when it's displayed in the Code Editor, you can use - ANS-The CodeLens Feature Which of the following is not true about a structure? - ANS-A structure lets you instantiate a reference type just like a class. An indexer - ANS-is a special type of property uses the this keyword in its declaration lets the user of a class access an item by using an index (all of the above) When coding a business class, why would you want to throw an argument exception from a property or method? - ANS-So the business class is completely self-contained and doesn't depend on classes that may be coded by other programmers to validate data The declaration for an event specifies - ANS-a delegate that will handle the event and the event's name To raise an event, you code - ANS-the name of the event along with its arguments Operator overloading is typically used to - ANS-define or redefine the function of an existing operator for a user-defined data type To overload the == operator, you must override Question options: - ANS-the Equals and GetHashCode methods inherited from the Object class
Code example 13- 2 customer.NameChanged += new EventHandler(Customer_NameChanged); (Refer to code example 13-2.) What is the name of the event? - ANS-NameChanged Code example 13- 2 customer.NameChanged += new EventHandler(Customer_NameChanged); (Refer to code example 13-2.) What is the name of the delegate? - ANS-EventHandler Code example 13- 2 customer.NameChanged += new EventHandler(Customer_NameChanged); (Refer to code example 13-2.) What is the name of the method that handles the event? - ANS-Customer_NameChanged When you code a statement in a form class that uses a property that throws an argument exception if the argument that's passed to it is invalid, you should - ANS- validate the argument before it is passed to the property so the exception is never thrown Which of the following can you not wire to an event? - ANS-a delegate