Y go for Interface? What is use of interface?

Answers were Sorted based on User's Feedback



Y go for Interface? What is use of interface?..

Answer / purushotham .tella

An Interface is a collection of semantically related
abstract members.Used To Support Multiple Inheritance

Is This Answer Correct ?    6 Yes 0 No

Y go for Interface? What is use of interface?..

Answer / venkat2050

interfaces is in concept of late binding which happen at
runtime which a part in OOPs concept
the interface has indexes of abstact
it should in public

Is This Answer Correct ?    4 Yes 2 No

Y go for Interface? What is use of interface?..

Answer / kiran

We will go for an interface when we want to implement a
specific behaviour.

ex:
1.My class x implements IDisposable interface to handle
cleaup operation. I have to implement that behaviour by
implementing the method interface method Dispose()
explicitly in my code.

class x:IDisposable
{}
2.My class y implements IComparable interface to implement
sorting between a list of objects created of type y. Here I
have to implement CompareTo method.

Is This Answer Correct ?    3 Yes 1 No

Post New Answer

More C Sharp Interview Questions

What is difference between string and stringbuffer in c#?

0 Answers  


Can you create sealed abstract class in c#?

0 Answers  


Where test director stores its data ? Database ,Local file etc...? I need to read this data from Visual Studio 2005 c# client. Regards

0 Answers  


Why delegates are type safe in c#?

0 Answers  


What is a delegate in c#?

0 Answers  






What is a strong name in c#?

0 Answers  


What?s the C# equivalent of C++ catch (?), which was a catch-all statement for any possible exception?

1 Answers   Visual Soft,


What is threading in c# with example?

0 Answers  


What is the difference between static class and singleton class in c#?

0 Answers  


What is difference between abstract class and interface in c#?

0 Answers  


Is arraylist type safe in c#?

0 Answers  


What is the c# equivalent of c++ catch (...), Which was a catch-all statement for any possible exception?

0 Answers  


Categories