Interview Questions

How do you mark a method obsolete?

C# Interview Questions and Answers


(Continued from previous question...)

8. How do you mark a method obsolete?

[Obsolete] public int Foo() {...}
or
[Obsolete(\"This is a message describing why this method is obsolete\")] public int Foo() {...}
Note: The O in Obsolete is always capitalized.

(Continued on next question...)

Other Interview Questions