473,505 Members | 13,805 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Concern about overriding methods

I have a class method defined as:

public virtual void SomeMethod(string key, Int32 id) {...}

In an descendent class I am typing in override and selecting the method from
the autoText. When it builds the shell for the method it is changing the
Int32 to an int ie)

public override void SomeMethod(string key, int id)
{
base.SomeMethod(key, id);
}

I am simply changing int back to Int32 but it struck me as strange... should
I be worried about this? Its in VS2003.

thx
Nov 16 '05 #1
2 897
int is just an alias for Int32. Refers to the same thing. The IDE probably
just uses the 'int' alias - since that gets the syntax highlighting. It
doesn't look at which alias the ancestor class used. Nor can it, since if
the ancestor is compiled into a DLL, which was used to refer to it: Int32 or
int, is not tracked.

"Jack Addington" <ja********@shaw.ca> wrote in message
news:uv**************@TK2MSFTNGP12.phx.gbl...
I have a class method defined as:

public virtual void SomeMethod(string key, Int32 id) {...}

In an descendent class I am typing in override and selecting the method
from the autoText. When it builds the shell for the method it is changing
the Int32 to an int ie)

public override void SomeMethod(string key, int id)
{
base.SomeMethod(key, id);
}

I am simply changing int back to Int32 but it struck me as strange...
should I be worried about this? Its in VS2003.

thx

Nov 16 '05 #2
Jack,

Int32 and int are the same thing.

Brian

Jack Addington wrote:

[...]

In an descendent class I am typing in override and selecting the
method from the autoText. When it builds the shell for the method
it is changing the Int32 to an int ie)

[...]

thx


Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
8686
by: Murat Tasan | last post by:
so i have a situation that i know cannot be solved directly, and i've already worked around it, but i was hoping to find an explanation as to why this behavior is as it is... i have an abstract...
5
2767
by: zero | last post by:
I'm having trouble with overriding methods in subclasses. I'll explain the problem using some code: class BaseClass { protected: void method2(); public: void method1();
4
2203
by: Rafael Veronezi | last post by:
I have some questions about override in inheritance, and virtual members. I know that you can you override a method by two ways in C#, one, is overriding with the new keyword, like: public new...
1
1585
by: Burkhard Perkens-Golomb | last post by:
Hi, I've a question about XML documentation of overridding methods and methods implementing an interface declaration: These methods are normally documented in the base class or interface. So I...
2
2008
by: byoukstetter | last post by:
So, I have an interface with several overriding methods: using System; using System.Collections.Specialized; namespace some.name.space { public interface IVrsPersistenceProvider { string...
6
27761
by: bryanbabula | last post by:
I have a question about overriding i was wondering if anyone could help me with, or even suggesting a better/different way. I have no idea if this can even be done or not. I was wondering if there...
9
1822
by: Steve Folly | last post by:
Hi, I had cause to change a base class virtual method's signature from const to non-const and realised the compiler didn't warn me about derived classes that hadn't changed: class Base {...
2
1987
by: =?Utf-8?B?d2R1ZGVr?= | last post by:
I know that I can't declare a method in an interface as virtual and override it, when I am using an explicit interface, but I am wondering if anyone else has come across this problem and how they...
17
1670
by: Donn Ingle | last post by:
Hi, Here's a framework for the questions: --- In a module, part of an API --- class Basis ( object ): def foo ( self, arg ): pass --- In user's own code --- class Child ( Basis ):
12
1524
by: danil52 | last post by:
Hello there, I have the following code: class Base { public: virtual void f() {cout << "Base::f()" << endl;} virtual void f(int) {cout << "Base::f(int)" << endl;} };
0
7213
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
7098
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
7298
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,...
1
7017
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5026
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4698
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3187
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
3176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
406
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.