An application includes a class named Person. The Person class includes a method named GetData. You need to ensure that the GetData() from the Person class. Which access modifier should you use for the GetData() method?
Suggested Answer:B🗳️
Protected - The type or member can be accessed only by code in the same class or structure, or in a class that is derived from that class. http://msdn.microsoft.com/en-us/library/ms173121.aspx The protected keyword is a member access modifier. A protected member is accessible within its class and by derived class instances.
Another version of the question is:
An application includes a class named Person. The Person class includes a method named GetData.
You need to ensure that the GetData() method can be used only by the Person class and not by any class derived from the Person class.
Which access modifier should you use for the GetData() method?
So it should be C:Private
Please read carefully during the exam
I think the answer should be C: Private. GetData is a method inside of Person and so can there be either
upvoted 3 times
...
This section is not available anymore. Please use the main Exam Page.70-483 Exam Questions
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
Igris
Highly Voted 5 years, 5 months agoJannie
5 years agoensa
4 years, 7 months agolh2607
Highly Voted 4 years, 11 months agonoussa
Most Recent 4 years, 5 months agoBen1999
4 years, 11 months ago