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.

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

i have a string aabccefsdss.how can i get the string abcefsd. or write the fallowing string with only character occurrence of once .

1 Answers  

Write code for palindrome?

10 Answers   Tech Mahindra,

hi my question is about understanding a text the user entered to a site , so i want to analyse that text looking for some specific items such as "honda" "shoffere" etc.. so if this site could help or could tell me where to go with such question ,i wonder. thanks

0 Answers  

A->B->C (EXTENDS) How the constructors are called when we created an object of C

3 Answers   Karur Vysya Bank KVB,

Can we create instance for Abstract class?

28 Answers   Wipro, SoftSol, Satyam, HCL,

How did you implemented classes in your project?

1 Answers   TCS,

what is output parameter and parameter array?

1 Answers   TCS,

Types of Unboxing?

2 Answers   Educomp,

What?s the .NET datatype that allows the retrieval of data by a unique key?

3 Answers  

in a town the percentage of total men is 52. the percentage of total literacy is 48. if total percentage of literate men is 35 of total population. write a program to find out the total no of illiterate men and women.

3 Answers   HCL,

What?s the implicit name of the parameter that gets passed into the class? set method?

3 Answers   Visual Soft,

C# Code for How to set readonly property to Id(database) value?

2 Answers   HCL,