Interview Questions

How do you mark a method obsolete?

C# Interview Questions and Answers


(Continued from previous question...)

143. How do you mark a method obsolete?

Assuming you've done a "using System;": [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 capitalized.

(Continued on next question...)

Other Interview Questions