exam questions

Exam 70-483 All Questions

View all questions & answers for the 70-483 exam

Exam 70-483 topic 3 question 4 discussion

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

You have an assembly named Assembly1 that is written in C#. Assembly1 has a method named Method1.
You add a new method named Method2 to Assembly1. Method2 is a newer version of Method1 and must be used by applications in the future.
You need to ensure that if a developer builds a project that uses Method1, the developer is notified that Method1 is deprecated.
What should you do?

  • A. Set an #if DEPRECATED preprocessor directive above Method1. Set a #endif preprocessor directive after Method1.
  • B. Set a #pragma warning disable preprocessor inside of Method1.
  • C. Mark Method1 with an ObsoleteAttribute attribute.
  • D. Mark Method1 with a Conditional attribute that is set to WARNING.
  • E. Set a #warning preprocessor directive inside of Method1.
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️
Reference:
https://docs.microsoft.com/en-us/dotnet/api/system.obsoleteattribute?view=netframework-4.7.2

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
MrAnderson
Highly Voted 4 years, 11 months ago
C is correct
upvoted 8 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 ...