We provide IT Services

Register Now Click On

Read More Tutorials Click On

Post Page Advertisement [Top]


Abstract class is a keyword in an object oriented programming language and we never be create object in abstract class,


We can use abstract keyword before class and before method.

abstract method close with semicolon(;) ,

Syntax:-

 abstract class Program
    {

        public abstract void show();
        public void XYZ()
        {
            Console.WriteLine("I am Abstract class");
        }

    }

abstract method con not be use open close curly braces({--}),

abstract method use just like interface.

Example :-

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

namespace abstractclass
{
    abstract class Program
    {

        public abstract void show();
        public void XYZ()
        {
            Console.WriteLine("I am Abstract class");
        }
    }
    class ABC : Program
    {
        public override void show()
        {
            Console.WriteLine("Hello");
        }
        public void get()
        {
            Console.WriteLine("Hi");
        }
    }

}

1 comment:

Anonymous said...

great site and good content

Post a comment

| Designed by Rockprogrammer