What is Interface Polymorphism?with E.g
Answer / sandeep negi
//Consider IShape interface like this
interface IShape
{string CalculateArea();}
class Circle : IShape
{
public string CalculateArea(){return "Circle area";}
}
class Rectangle : IShape
{
public string CalculateArea(){return "Rectangle
area";}
}
//implement function
private string ProcessArea(IShape shape)
{return shape.CalculateArea();}
//call this function from main or from button click event
like this
private void button1_Click(object sender, EventArgs e)
{
Rectangle r = new Rectangle();
Circle c = new Circle();
MessageBox.Show(ProcessArea(r));
MessageBox.Show(ProcessArea(c));
}
| Is This Answer Correct ? | 3 Yes | 2 No |
what is the difference between arraylist and hash table using a simple program?
3 Answers CGI, Polaris, SunGard,
What does f mean in c#?
Hi to everybody. Lastweek i had taken an interview on c#. They ask what is boxing & unboxing, Masking.Please tell the answer and it is useful for me.
What are the important concepts in OOPS
Is Multiple-inheritance supported by c#?
write a program to find the biggest palindrome in the given string
Explain how do you convert a value-type to a reference-type?
how can one use hcl and c sharp together?
What is ado c#?
What are the basic string operations? Explain.
what is the equivalent to regsvr32 and regsvr32 /u a file in .net development?
Where are value types stored in c#?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)