Sunday 3 December 2017

C# Program to Create Obsolete Class


Code:

using System;
class Program
{
    static void Main()
    {
        MethodA();
        MethodB();
        Console.Read();
    }
    [Obsolete("Use MethodB Instead")]
    static void MethodA()
    {
    }
    static void MethodB()
    {
        Console.WriteLine(" MethodA shows an Warning when called and MethodB is not an Obsolete Method ");
    }
}


Output:

MethodA shows an Warning when called and MethodB is not an Obsolete Method


More C# Programs:



















100+ Best Home Decoration Ideas For Christmas Day 2019 To Make Home Beautiful

Best gifts for Christmas Day | Greeting cards for Christmas Day | Gift your children a new gift on Christmas day This Christmas d...