Csharp/C Sharp by API/System/Obsolete
Версия от 15:31, 26 мая 2010; (обсуждение)
Obsolete(String name)
using System;
public class TestAno1 {
[Obsolete("Use myMeth2, instead.")]
static int myMeth(int a, int b) {
return a / b;
}
// Improved version of myMeth.
static int myMeth2(int a, int b) {
return b == 0 ? 0 : a /b;
}
public static void Main() {
Console.WriteLine("4 / 3 is " + TestAno1.myMeth(4, 3));
Console.WriteLine("4 / 3 is " + TestAno1.myMeth2(4, 3));
}
}