473,785 Members | 2,895 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

new versus override

Could someone explain the implications of the differences between using
'new' and 'override' on a member declaration, please.

I checked out MSDN but it's not exactly written for the beginner. E.g.
on Name Hiding, it starts with this: "The scope of an entity typically
encompasses more program text than the declaration space of the
entity." That whizzing sound you're hearing is it going over my head!

SSG

Nov 17 '05
16 1747
Yes, a little bit wrong.

New is not only for object creation. It's also a modifier to class
methods/properties declaration.


--
With best regards,
Andrew

http://www.codeproject.com/script/pr...asp?id=1181072
<sh**********@y ahoo.com> wrote in message
news:11******** **************@ g49g2000cwa.goo glegroups.com.. .
I can be wrong
Both are keywords New is for object creation
and overrides if you want to overirde a method in inheritance

Shivprasad Koirala
C# , VB.NET , SQL SERVER , ASP.NET Interview Questions
http://www.geocities.com/dotnetinterviews/

Nov 17 '05 #11
thanks Andrew.

Nov 17 '05 #12
thanks Andrew.

Nov 17 '05 #13
ssg31415926 wrote:
Could someone explain the implications of the differences between
using 'new' and 'override' on a member declaration, please.

I checked out MSDN but it's not exactly written for the beginner.
E.g. on Name Hiding, it starts with this: "The scope of an entity
typically encompasses more program text than the declaration space of
the entity." That whizzing sound you're hearing is it going over my
head!

SSG


http://www.yoda.arachsys.com/csharp/faq/#override.new
Nov 17 '05 #14
ssg31415926 wrote:
Could someone explain the implications of the differences between
using 'new' and 'override' on a member declaration, please.

I checked out MSDN but it's not exactly written for the beginner.
E.g. on Name Hiding, it starts with this: "The scope of an entity
typically encompasses more program text than the declaration space of
the entity." That whizzing sound you're hearing is it going over my
head!

SSG


http://www.yoda.arachsys.com/csharp/faq/#override.new
Nov 17 '05 #15
Thanks for all of your answers and for the links to other documents
which I'll be absorbing over the next few days (or weeks...months. ..).

I've used overrides before and I get them. Next task is to think of a
real-world example where I might need to use new so that I can lock it
down in my brain.

Nov 17 '05 #16
Thanks for all of your answers and for the links to other documents
which I'll be absorbing over the next few days (or weeks...months. ..).

I've used overrides before and I get them. Next task is to think of a
real-world example where I might need to use new so that I can lock it
down in my brain.

Nov 17 '05 #17

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

Similar topics

81
5186
by: sinister | last post by:
I wanted to spiff up my overly spartan homepage, and started using some CSS templates I found on a couple of weblogs. It looks fine in my browser (IE 6.0), but it doesn't print right. I tested the blogs, and one definitely didn't print right. Surveying the web, my impression is that CSS is very unreliable, because even updated browsers fail to implement the standards correctly. So should one just avoid CSS? Or is it OK if used...
15
122154
by: Gérard Talbot | last post by:
Hello all, I'd like to know and understand the difference between, say, <img src="/ImageFilename.png" width="123" height="456" alt=""> and <img src="/ImageFilename.png" style="width: 123px; height: 456px;" alt="">
2
2314
by: Fredrik Melin | last post by:
Hi, I have a vendor that requires me to send empty value, e.g. <OrderIDInfo /> problem is that my xslt need to add attributes, doing this <OrderIDInfo> <xsl:attribute name="orderID"> <xsl:value-of select="Root_Element/InvoiceHeader/Customer_PO_No" /> </xsl:attribute>
54
5867
by: Matt | last post by:
How do we define systems programs? when we say systems programming, does it necessary mean that the programs we write need to interact with hardware directly? For example, OS, compiler, kernel, drivers, network protocols, etc...? Couple years ago, yes, I understand this is definitely true. However, as the software applications become more and more complicated, some people try to argue that. Some people argue the definition of systems...
4
3213
by: Chris | last post by:
This is something that has been bugging me for some time. When exactly should I be using == instead of .Equals() ? I see a lot of code that performs object evaluation e.g. Is Object1 the same as Object2 by using == which works but shouldn't it be using .Equals()? e.g. Object1.Equals(Object2) I believe == should be using for simple type evaluation e.g. int a = 0;
3
2311
by: Neil Zanella | last post by:
Hello, I would like to ask the following question concerning the C# as operator. I would like to know whether the difference between using a C-style cast such as double x = 0; float y = (double) x; and using the as operator is simply that as works on references rather
0
238
by: ssg31415926 | last post by:
Could someone explain the implications of the differences between using 'new' and 'override' on a member declaration, please. I checked out MSDN but it's not exactly written for the beginner. E.g. on Name Hiding, it starts with this: "The scope of an entity typically encompasses more program text than the declaration space of the entity." That whizzing sound you're hearing is it going over my head! SSG
1
1344
by: robert d via AccessMonster.com | last post by:
I'm a fledgling developer and am just starting to get my app out to specific clients. I have been asked to bid on a project because my app already does over 90% of what the client wants. My question is with regards to pricing of the proposal. It seems like I should include a license fee for my app as it currently is in the pricing section of the proposal. If I don't do this, then they might claim that they paid for everything as...
0
3558
by: shumaker | last post by:
What's the difference between overriding OnFormClosing or simply wiring up my own event handler OnClosing that is not declared as override?
0
9480
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
10325
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
10148
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...
1
10091
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7499
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6740
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4053
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
3646
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.