Re: Strings.. Objects or not???
From: Patrick Steele [MVP] (patrick_at_mvps.org)
Date: 07/09/04
- Next message: Cor Ligthert: "Re: Strings.. Objects or not???"
- Previous message: Grigs: "RE: Check If User Exists..."
- In reply to: Rigga: "Re: Strings.. Objects or not???"
- Next in thread: Herfried K. Wagner [MVP]: "Re: Strings.. Objects or not???"
- Reply: Herfried K. Wagner [MVP]: "Re: Strings.. Objects or not???"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 9 Jul 2004 09:52:58 -0400
In article <40ee9f0e$0$552$ed2619ec@ptn-nntp-reader02.plus.net>, s@v.c
says...
> Thanks all for your replies but I'm still confused.
>
> So coding "veg" anywhere will only ever create one object?
Yes. It's called "String Interning" and the String.Intern method has a
description of what it's for. Basically (from the docs):
"The common language runtime conserves string storage by maintaining a
table, called the intern pool, that contains a single reference to each
unique literal string declared or created programmatically in your
program. Consequently, an instance of a literal string with a particular
value only exists once in the system."
-- Patrick Steele Microsoft .NET MVP http://weblogs.asp.net/psteele
- Next message: Cor Ligthert: "Re: Strings.. Objects or not???"
- Previous message: Grigs: "RE: Check If User Exists..."
- In reply to: Rigga: "Re: Strings.. Objects or not???"
- Next in thread: Herfried K. Wagner [MVP]: "Re: Strings.. Objects or not???"
- Reply: Herfried K. Wagner [MVP]: "Re: Strings.. Objects or not???"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|