What is the Abstract class and Overriding in C#? Example.

  Example 

 abstract class Student
    {
       public abstract void Name();
    }
    class Student_Details:Student
    {
        public override void Name()
        {
            Console.WriteLine("Kulshresth Kumar");
        }
    }--------------------------

 class Program
    {
        static void Main(string[] args)
        {
            Student_Details obj = new Student_Details();
            obj.Name();
            Console.ReadLine();
        }
    }
Share:

No comments:

Post a Comment

Friday, 28 June 2019

What is the Abstract class and Overriding in C#? Example.

  Example 

 abstract class Student
    {
       public abstract void Name();
    }
    class Student_Details:Student
    {
        public override void Name()
        {
            Console.WriteLine("Kulshresth Kumar");
        }
    }--------------------------

 class Program
    {
        static void Main(string[] args)
        {
            Student_Details obj = new Student_Details();
            obj.Name();
            Console.ReadLine();
        }
    }

No comments:

Post a Comment

Popular

Total Pageviews

Archive