473,468 Members | 1,437 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

What does the modifier have methid from interface?

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
9 1131
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
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
>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
>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
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
>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
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
>hmm i've said in the interface not in the implementing it
class...

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

"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

52
by: Tony Marston | last post by:
Several months ago I started a thread with the title "What is/is not considered to be good OO programming" which started a long and interesting discussion. I have condensed the arguments into a...
3
by: steve | last post by:
Can someone give me an example of using the ’e’ pattern modifier in php regex: http://www.php.net/manual/en/reference.pcre.pattern.modifiers.php Thanks in advance. Wish the manual had some...
35
by: Sunil | last post by:
Hi all, I am using gcc compiler in linux.I compiled a small program int main() { printf("char : %d\n",sizeof(char)); printf("unsigned char : ...
0
by: memememe | last post by:
I want to make methods of a class be internal, but this classes implements an interface and the methods of the interface are the ones tha I want to make internal. I tried creating the interface,...
5
by: Gelios | last post by:
Hello All! I am going to crazy and feeling myself so stupid but I don't understand such behaviour. I have code: public int getNextAgentId() { Int32 agent_id = 0; IDataReader dr =...
4
by: Gery D. Dorazio | last post by:
Gurus, If a static variable is defined in a class what is the scope of the variable resolved to for it to remain 'static'? For instance, lets say I create a class library assembly that is...
21
by: Niu Xiao | last post by:
I see a lot of use in function declarations, such as size_t fread(void* restrict ptr, size_t size, size_t nobj, FILE* restrict fp); but what does the keyword 'restrict' mean? there is no...
9
by: JT | last post by:
Here is the overall structure I will be referring to: End-program ProvideWorkFlow.dll Forms and methods that properly manipulate calls to methods in AccessUtils AccessUtils (a web service)...
2
klarae99
by: klarae99 | last post by:
Hello, I am working in Access 2003 to create a database to record information about an annual fundraiser. I was hoping someone could review my table structure and make sure that it is normalized...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.