Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

WHAT IS THE EXACT USE OF INTERFACE(DONT TELL USE FOR
MULTIPLE INHERITANCE)

Answer Posted / arvind nagar

Interface is mainly use to apply restrictions in accesing
the members.
For eg.-
using System;
Interface Sales
{
Void prediction();
}
Interface Hr
{
Void SalayInfo();
}
Class Abc:Sales,Hr
{
Public void Pediction()
{
x.WriteLine("Sales for 2008 will 2000 laptops");
}
Public void SalryInfo()
{
x.WriteLine("Salary is going to increment by 30%");
}
Public void Hello()
{
x.WriteLine("Hello frnds");
}
}
class test
{
public static void main()
{
Hr a= new Abc();
a.SalaryInfo();
}
}

O/p-- Salary is going to increment by 30%.
Suppose we wish to access the Hello() function, then we
can't access the a.Hello();--it gives error.
b'coz Hr doesn't contain a
definition of Hello.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I format in c#?

859


What is the major difference between a custom control and user control?

1044


Is stringbuilder thread safe c#?

867


What is the difference between read and readline in c#?

920


Explain the difference between passing parameters by value and passing parameters by reference with an example?

926


Which operator cannot be overloaded in c sharp?

871


What is the implicit name of the parameter that gets passed into the set method/property of a class?

924


How do partial classes work in c#?

940


Why do we use hashtable in c#?

957


What is foreach loop in c#?

960


What is the difference between abstract and abstraction?

850


Can I call a virtual method from a constructor/destructor?

879


What does using do in c#?

902


What is a copy constructor in c#?

987


What is Implementation inheritance and interface inheritance?

998