class vs interface
-
hi, could you please some one tell me when should I use interface? what is it,exactly?
-
hi, could you please some one tell me when should I use interface? what is it,exactly?
No thanks. If one answers one such question, you'll be back asking about inner classes, abstract classes, patterns, inversion of control, and many more. Get yourself an introductory book to C# and study it, there is much to learn, and it doesn't make sense for anyone to write it down here piece by piece. Now when you have a specific question relating to some code of yours, we all will be willing to help you out. :)
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
-
hi, could you please some one tell me when should I use interface? what is it,exactly?
Always.
-
hi, could you please some one tell me when should I use interface? what is it,exactly?
-
hi, could you please some one tell me when should I use interface? what is it,exactly?
-
hi, could you please some one tell me when should I use interface? what is it,exactly?
-
No,
this
is the current instance :-)Sort of a cross between Lawrence of Arabia and Dilbert.[^]
-Or-
A Dead ringer for Kate Winslett[^] -
No,
this
is the current instance :-)Sort of a cross between Lawrence of Arabia and Dilbert.[^]
-Or-
A Dead ringer for Kate Winslett[^] -
hi, could you please some one tell me when should I use interface? what is it,exactly?
Ditto what everyone else has said. Also, I think at your stage of learning it is very informative to look closely at some of the existing interfaces in the framework, and how they are implemented. An example, one of many off the top of my head, is say
IComparable
and/orIComparable<T>
. Then read the msdn blurb on theList<T>.Sort()
method, and think about how implementing one of those interfaces in some class you design makes it possible to sort a list of instances of that class. Again, I am not contradicting the good advice given by the previous posts, I am simply saying that studying some of the built-in interfaces and finding examples of their usage can be ONE aid to understanding interfaces in general. -
No,
this
is the current instance :-)Sort of a cross between Lawrence of Arabia and Dilbert.[^]
-Or-
A Dead ringer for Kate Winslett[^] -
hi, could you please some one tell me when should I use interface? what is it,exactly?
Try Google, It is free.