use of Obsolete in c#

Obsolete

what is Obsolete?

what is ObsoleuteAttribute?

Where is use Obsolete?


Meaning of Obsolete mean
- no longer produced or used; out of date

- less developed than formerly or in a related species


1. Marks the program elements that are no longer in use. This class cannot be inherited.


using System;
namespace _01DemoObsolete
{
class Program
{
static void Main(string[] args)
{
RebookForAmadeusCrypticCommand obj= new RebookForAmadeusCrypticCommand();
RebookWorldSpan objRebookWorldSpan = new RebookWorldSpan();
}
}
}
view raw program.cs hosted with ❤ by GitHub



using System;
namespace _01DemoObsolete
{
[Obsolete("Use Another method RebookForAmadeusCrypticCommandNew. Don't invoke this method")]
class RebookForAmadeusCrypticCommand
{
}
class RebookForAmadeusCrypticCommandNew
{
}
[Obsolete("Use RebookWorldSpanNew, Don't invoke this method. its old",true)]
class RebookWorldSpan
{
}
class RebookWorldSpanNew
{
}
}

Next PostNewer Post Previous PostOlder Post Home

0 comments:

Post a Comment