Constructor in Abstract class

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

namespace Constructor_in_Abstract_class
{
    abstract class girl
    {
        public girl()
        {
            Console.WriteLine("Constructor of Girl");
        }

        abstract public void boy();
    }

    class student : girl
    {
        public student()
        {
            Console.WriteLine("Constructor of Student");
        }

        public override void boy()
        {
            Console.WriteLine("Constructor of Boy");
        }
    }


    class Program
    {
        static void Main(string[] args)
        {
            student obj = new student();

            obj.boy();

            Console.Read();
        }
    }
}

SHARE THE KNOWLEDGE


  

Advertisements

About Dinesh

I am engineering student........ I am selected in Microsoft Student Partner as MSP............

Posted on August 25, 2011, in .NET, C#, Knowledge, Language. Bookmark the permalink. Leave a comment.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: