Valid 98-361 Dumps shared by ExamDiscuss.com for Helping Passing 98-361 Exam! ExamDiscuss.com now offer the newest 98-361 exam dumps, the ExamDiscuss.com 98-361 exam questions have been updated and answers have been corrected get the newest ExamDiscuss.com 98-361 dumps with Test Engine here:
You need to allow a consumer of a class to modify a private data member. What should you do?
Correct Answer: C
Explanation/Reference: In this example (see below), the Employee class contains two private data members, name and salary. As private members, they cannot be accessed except by member methods. Public methods named GetName and Salary are added to allow controlled access to the private members. The name member is accessed by way of a public method, and the salary member is accessed by way of a public read-only property. Note: The private keyword is a member access modifier. Private access is the least permissive access level. Private members are accessible only within the body of the class or the struct in which they are declared Example: class Employee2 { private string name = "FirstName, LastName"; private double salary = 100.0; public string GetName() { return name; } public double Salary { get { return salary; } } }