Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Interface Implementation Problem
Message
De
27/06/2010 22:32:05
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, États-Unis
 
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01470728
Message ID:
01470747
Vues:
44
>I changed the scope of a method from public to protected, and now I get this:
>
>
>Chess.PieceBase' does not implement interface member 'Chess.IPiece.DetermineTargets()'. 'Chess.PieceBase.DetermineTargets()
>cannot implement an interface member because it is not public.	C:\Projects\Chess\Chess\Pieces\PieceBase.cs
>
>
>Why does a method defined in an interface need to be public?

Because if a method is not public, then it won't be used outside of the class, and therefore doesn't need to be defined in the interface.
Very fitting: http://xkcd.com/386/
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform