By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,567 Members | 1,609 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,567 IT Pros & Developers. It's quick & easy.

What does the modifier have methid from interface?

P: n/a
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?
Nov 15 '05 #1
Share this Question
Share on Google+
9 Replies


P: n/a
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

"Vladimir Bezugliy" <vb**@inbox.ru> wrote in message
news:e8****************************@phx.gbl...
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?

Nov 15 '05 #2

P: n/a
I answered your question in another group. Please don't multipost.
--
____________________
Klaus H. Probst, MVP
http://www.vbbox.com/

"Vladimir Bezugliy" <vb**@inbox.ru> wrote in message
news:e8****************************@phx.gbl...
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?

Nov 15 '05 #3

P: n/a
>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"?
Nov 15 '05 #4

P: n/a
>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?

Nov 15 '05 #5

P: n/a
in the interface method is public virtual

<an*******@discussions.microsoft.com> wrote in message
news:e3****************************@phx.gbl...
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"?

Nov 15 '05 #6

P: n/a
>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(){}
}
Nov 15 '05 #7

P: n/a
hmm i've said in the interface not in the implementing it class...

"Vladimir Bezugliy" <vb**@inbox.ru> wrote in message
news:e5****************************@phx.gbl...
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(){}
}

Nov 15 '05 #8

P: n/a
>hmm i've said in the interface not in the implementing it
class...

But question was about class :-)
Nov 15 '05 #9

P: n/a

"Vladimir Bezugliy." <vb**@inbox.ru> wrote in message
news:db****************************@phx.gbl...
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.


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 =)
--
____________________
Klaus H. Probst, MVP
http://www.vbbox.com/
Nov 15 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.