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

How do you create user defined data types in c#?

0 Answers  


What are custom exceptions in C#?

0 Answers   Arigo Infotech,


What is class method c#?

0 Answers  


What are accessors?

0 Answers  


How can you overload a method?

3 Answers  






How do you create multiple inheritance in C#?

5 Answers   Microsoft,


What are concrete classes?

0 Answers  


What is the difference between Static, Const and read only?

0 Answers  


Can you see a loop recorder?

0 Answers  


What?s a satellite assembly?

2 Answers  


what are some characteristics of an array?

0 Answers  


What does the keyword virtual mean in the method definition?

3 Answers   Ipog Software, Satyam, Visual Soft,


Categories