Implement Inheritance in C#

March 28, 2019 · Team EasyExamNotes · 1 min read (est.) · 1 comments

Share on WhatsApp
PRINCIPLES OF PROGRAMMING LANGUAGES

PRACT. Implement inheritance in C#.
using System;
namespace ATC
{
    class CSE
    {
        public int age = 22;
    }
    class Child : CSE 
    {
        static void Main(string[] args)
        {
            Child obj = new Child();
            Console.WriteLine(“{0}”, obj.age);
            Console.ReadKey();
        }
    }
}

Discussion

Ask a question, share your thoughts or report an error.

1 comments

  1. That is very fascinating, You are an overly skilled blogger.
    I’ve joined your rss feed and sit up for in the hunt for extra
    of your wonderful post. Additionally, I’ve shared your site in my social networks!

Sign in to participate in the discussion.

Join the discussion