Showing posts with label C#. Show all posts
Showing posts with label C#. Show all posts

Tuesday, June 17, 2014

What is Interface?

Ans: Interface is the contract between programmer and technology. It Means that whatever the abstract method that a interface contain, you must override all (this is the contract).

Example:

Interface Contract
{
       void ContractHere();
}

class MakeContract : Contract
{
        void ContractHere()
        {
                Console.WriteLine("Contract Override Successfully");
        }
}
               

Why constructor is not inherit?

Inheritance said - only property and behaviour are inherited, and constructor is not a behaviour and not a property so that it is not inherited.