C# Program to Demonstrate the Obsolete Attribute

You are currently viewing C# Program to Demonstrate the Obsolete Attribute

C# program to demonstrate the Obsolete attribute

//C# program to demonstrate the Obsolete attribute.

using System;

class Program
{
    [Obsolete("Absoluted method")]
    public static void SayHello()
    {
        Console.WriteLine("Hello World");
    }
    public static void Main()
    {
        SayHello();
    }
}

Output

Hello World
Press any key to continue . . .

Ranjith

Hi, I'm Manoj a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Diksha. Here, I post about programming to help developers.

Leave a Reply