Interfaces

  • Thread starter Thread starter a.mustaq
  • Start date Start date
A

a.mustaq

Hi All,

Is it compalsory to impliment all the methods
defined in the interface by the derived class.
 
Hi All,

Is it compalsory to impliment all the methods
defined in the interface by the derived class.
If you want to instantiate object of the class, yes.
if you don't, you can have an abstract class.
 
Yes. Otherwise, you will get a compile error. The implementation can
be empty, and do nothing (unless you need a return value), but you have to
have an implementation.
 
Hello a,

it depends on your project and used methodology
for example if u master TDD, then using interfaces is rather usable, because
very often you need to "mock" your method calls

---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo

am> Hi All,
am>
am> Is it compalsory to impliment all the
am> methods defined in the interface by the derived class.
am>
 
Hello Michael ,


MN> it depends on your project and used methodology
MN> for example if u master TDD, then using interfaces is rather usable,
MN> because
MN> very often you need to "mock" your method calls

sorry, missed the point :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top