473,657 Members | 2,392 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(stri ng 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(stri ng 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 901
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********@sha w.ca> wrote in message
news:uv******** ******@TK2MSFTN GP12.phx.gbl...
I have a class method defined as:

public virtual void SomeMethod(stri ng 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(stri ng 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
8690
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 class: public abstract class Function { public abstract Number evaluate(Number parameter); } and i have a descendant of that class:
5
2780
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
2216
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 bool Equals(object obj) {} Another is using the override keyword, like: public override bool Equals(object obj) {}
1
1604
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 don't want to write new documentation when overriding or implementing. But if I leave out documentation and compile my assembly with "/doc" the compiler warns me about missing documentation. How can I tell the compiler that these methods don't...
2
2021
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 Select(string idName, string tableName, string whereClause);
6
27797
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 was anyway to force a class to call a base class's method that it is overriding? Almost the same way you have to call a base class's constructor if it has arguments. (example ** assuming the Person class's constructor has (string FirstName) as...
9
1828
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 { public:
2
1998
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 handled it? I would definately prefer to use explicit interfaces, but I also know I shouldn't mix and match explicit versus implicit interfaces and don't seem to have a choice here? Any thoughts on this?
17
1683
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
1546
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
8323
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8838
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8739
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8613
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7351
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2740
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1969
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1732
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.