Static methods in VB.NET Intafaces?

  • Thread starter Thread starter James Ramaley
  • Start date Start date
J

James Ramaley

I read that it is possble to actually have method implementation code
in the declaration of VB.NET Interfaces so that it doesn't have to be
re-written in the classes that Implement the Interface. However, I
couldn't find an example. Could someone post a simple example?

thanks
 
Hi James

Interfaces cannot contain code. If you have a method that you want to
implement only once, declare it as MustOverride. Then implement the
interface in a base class that you inherit from for all other cases.

HTH

Charles
 
* (e-mail address removed) (James Ramaley) scripsit:
I read that it is possble to actually have method implementation code
in the declaration of VB.NET Interfaces so that it doesn't have to be
re-written in the classes that Implement the Interface. However, I
couldn't find an example. Could someone post a simple example?

Why not create a 'MustInherit' class that provides the implementations?
 

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