C# Program to Demonstrate the Example of a Sealed Class

When we search for specific information, some articles do not find the information we need. But we hope you find the ideas you need in the C# Program to Demonstrate the Example of a Sealed Class article. Let’s go into the article.

C# Program to Demonstrate the Example of a Sealed Class

C# Program to Demonstrate the Example of a Sealed Class

// Program to demonstrate the 
// example of a sealed class in C#.

using System;

sealed class MySealedClass
{
    public int num1;
    public int num2;

    public MySealedClass()
    {
        num1 = 500;
        num2 = 800;
    }
}

class SealedTest
{
    static void Main()
    {
        MySealedClass OB = new MySealedClass();
        
        Console.WriteLine(OB.num1);
        Console.WriteLine(OB.num2);
    }
}
500
800
Press any key to continue . . .

Final Words

We hope you enjoy the article C# Program to Demonstrate the Example of a Sealed Class. The reason for that is that we hope that all your doubts and all doubts will be resolved through this article. Thanks

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

Share on:

Leave a Comment