What does the modifier have methid from interface?

  • Thread starter Thread starter Vladimir Bezugliy
  • Start date Start date
V

Vladimir Bezugliy

I have next interface:
interface I
{
void F();
}

And next class implements this interface:
class MyClass : I
{
void F(){};
}

What does the modifier have the method MyClass::F() by
default?
 
By default F has private modifier

However, compiler won't let you compile the code, because in order to
implement the interface you have to declare that method as public
 
By default F has private modifier

You do not understand me right.
Metod from ionterface is public by default.
But what bublic is it - "public virtual" or "public
virtual sealed"?
 
I answered your question in another group. Please don't
multipost.

Your answer is not full.
And I think that this question more correspond to this
group.
Is there any possibility to remove messages from
dotnet.general?
 
in the interface method is public virtual

You do not understand me right.
Metod from ionterface is public by default.
But what bublic is it - "public virtual" or "public
virtual sealed"?
 
in the interface method is public virtual

No :-)))
Try to compile next code :-)

interface I
{
void F();
}

class Base : I
{
public void F(){}
}

class Derived : Base
{
public override void F(){}
}
 
hmm i've said in the interface not in the implementing it
class...

But question was about class :-)
 
Vladimir Bezugliy. said:
multipost.

Your answer is not full.
And I think that this question more correspond to this
group.

If you do, then crosspost. Don't multipost.
Is there any possibility to remove messages from
dotnet.general?

I'm not sure you can still issue cancel commands on this server, but it
doesn't matter. Just try not to do it =)
 
Back
Top