exam questions

Exam 70-483 All Questions

View all questions & answers for the 70-483 exam

Exam 70-483 topic 3 question 13 discussion

Actual exam question from Microsoft's 70-483
Question #: 13
Topic #: 3
[All 70-483 Questions]

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?

  • A. Internal
  • B. Protected
  • C. Private
  • D. Protected internal
  • E. Public
Show Suggested Answer Hide Answer
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.

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Igris
Highly Voted 5 years, 5 months ago
You need to ensure that the GetData() from the Person class can only get accessed by the Person class or classes that inherit from Person.
upvoted 43 times
Jannie
5 years ago
Thank you @Igris
upvoted 2 times
...
ensa
4 years, 7 months ago
Base on this is B
upvoted 4 times
...
...
lh2607
Highly Voted 4 years, 11 months ago
B is correct. (Thanks Igris for full question)
upvoted 5 times
...
noussa
Most Recent 4 years, 5 months ago
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
upvoted 1 times
...
Ben1999
4 years, 11 months ago
I think the answer should be C: Private. GetData is a method inside of Person and so can there be either
upvoted 3 times
...
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.

SaveCancel
Loading ...