Is there any difference betwen public interface declaration and interface? (I thought that interfaces are public by default).
I am asking because VS2012 is whining about access levels.
I have declared:
interface Ixyz
{nothing important here}
and property (in another class who is using Ixhz as its type):
public Ixhz Somename
{nothing important here}
And when I try to compile the project, it whines about access levels but when I declare interface like public interface Ixyz it stops doing it. Are there any consequences of adding public to interface?
Members in interfaces are always public, and in fact cannot have access modifiers.
Interfaces themselves have the same default access level as other types.
Specifically, top-level types are internal by default, and nested types are private by default.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With