string-interning Questions

2

Solved

I dont understand : MSDN says http://msdn.microsoft.com/en-us/library/system.string.intern.aspx Consequently, an instance of a literal string with a particular value only exists once in the ...
Eliza asked 1/1, 2012 at 7:49

9

Solved

class Test { public static void main(String...args) { String s1 = "Good"; s1 = s1 + "morning"; System.out.println(s1.intern()); String s2 = "Goodmorning"; if (s1 == s2) { System.out.println(...
Case asked 15/8, 2011 at 13:13

2

I am looking to a debugging tool that can list the strings that have been internalized? Ideally, I would like to put a mark and have a list of the strings that been added after that mark. Thanks i...
Doubleness asked 30/5, 2011 at 19:21

1

Solved

This is a very Delphi specific question (maybe even Delphi 2007 specific). I am currently writing a simple StringPool class for interning strings. As a good little coder I also added unit tests and...

3

my question is if intern is working with string and string having a SPC(string pool constant) for it and intern concept also working with integer also, so is there any integer pool constant?if not ...
Scaleboard asked 1/6, 2011 at 9:40

2

Solved

Two Questions. When we declare literal strings, we search whether there is the same string in string pool of heap. Is this also an interning (method intern of class String)? In my thought, each l...
Ethanethane asked 21/2, 2011 at 1:59

1

Solved

When I use a .resx file to store fixed string values (to be bound to controls on an .aspx page), are these strings interned? I presume the compiler reads in the strings from the XML file and repla...
Companionate asked 20/1, 2011 at 9:39

3

Solved

When should one compare Strings as objects and when should one use their equals method? To make sure, I always use equals, but that doesn't seem very efficient. In what situations can I be certain ...
Fastening asked 7/10, 2010 at 20:46

5

I've seen many primitive examples describing how String intern()'ing works, but I have yet to see a real-life use-case that would benefit from it. The only situation that I can dream up is having ...
Thulium asked 18/8, 2010 at 8:59

1

Solved

I tried to look at Java's String#intern() method, but it's public native String intern(); In general, how is interning implemented? In String's case?
Valiancy asked 24/7, 2010 at 2:49

2

Solved

I am writing a Codec to process messages sent over TCP using a bespoke wire protocol. During the decode process I create a number of Strings, BigDecimals and dates. The client-server access pattern...
Fluky asked 19/5, 2010 at 11:29

3

Solved

If I have a HashMap that looks like this: HashMap<String, MyObject> where the String key is a field in MyObject, does this string value get stored twice? So when I add entries: _myMap.pu...
Tinhorn asked 13/3, 2010 at 9:45

2

Solved

If you are parsing, lets just say HTML, once you read the element name, will it be beneficial to intern it? The logic here is that this parser will parse the same strings (element names) over and o...
Lawley asked 31/8, 2009 at 8:1

5

Solved

From a brief look using Reflector, it looks like String.Substring() allocates memory for each substring. Am I correct that this is the case? I thought that wouldn't be necessary since strings are i...
Joses asked 4/7, 2009 at 15:42

3

Solved

This code snippet is from C# in Depth static bool AreReferencesEqual<T>(T first, T second) where T : class { return first == second; } static void Main() { string name = "Jon"; str...
Hurtless asked 30/6, 2009 at 3:48

© 2022 - 2024 — McMap. All rights reserved.