Skip to main content

Sealed Class in C sharp #

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication13
{

    sealed class x
    {
      public   int x2, y2, z2;
      public x()
      {
          x2 = 123;
          y2 = 456;
          z2 = 789;
      }
        public void display()
        {
            Console.WriteLine("Display 1");
        }
        public void print()
        { Console.WriteLine("Print 1"); }
            }
   
   

        class Program
    {
        static void Main(string[] args)
        {
            x ob = new x();
            Console.WriteLine(ob.x2);

          ob.display();
          Console.Read();
        }
}
}

Comments

Popular posts from this blog

unix commands