Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #39836
| Path | csiph.com!news.swapon.de!aioe.org!LeVffQP25j5GAigzc2gaQA.user.46.165.242.75.POSTED!not-for-mail |
|---|---|
| From | Arne Vajhøj <arne@vajhoej.dk> |
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: How do I dereference a static string |
| Date | Thu, 3 Nov 2022 20:14:23 -0400 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <tk1lgv$1i5c$1@gioia.aioe.org> (permalink) |
| References | <282053db-e7b9-4f0a-a66c-12f53021fd55n@googlegroups.com> <240bceee-4aa9-4c13-85e7-de1946350bb4n@googlegroups.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8; format=flowed |
| Content-Transfer-Encoding | 7bit |
| Injection-Info | gioia.aioe.org; logging-data="51372"; posting-host="LeVffQP25j5GAigzc2gaQA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org"; |
| User-Agent | Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 |
| X-Notice | Filtered by postfilter v. 0.9.2 |
| Content-Language | en-US |
| Xref | csiph.com comp.lang.java.programmer:39836 |
Show key headers only | View raw
On 11/3/2022 3:37 PM, e.d.pro...@gmail.com wrote: > On Thursday, November 3, 2022 at 1:05:17 PM UTC-4, C.D. Altenburg, Ph.D, wrote: >> Say I have the string >> >> public static string foo = "foo"; >> >> can I just do >> >> foo = null; >> >> in order to dereference that string? > That depends what you mean by dereference. If you want to clear the > value, sure set to null like that would work. If you mean remove the > variable from memory, static values are tied to the class, you'd have > to unload the class. Note that: ... foo = "foo"; ... foo = null; Involves two memory locations. The variable foo that is a reference and a String object containing "foo". Arne
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
How do I dereference a static string "C.D. Altenburg, Ph.D," <cdalten@gmail.com> - 2022-11-03 10:05 -0700
Re: How do I dereference a static string Andreas Leitgeb <avl@logic.at> - 2022-11-03 17:38 +0000
Re: How do I dereference a static string "e.d.pro...@gmail.com" <e.d.programmer@gmail.com> - 2022-11-03 12:37 -0700
Re: How do I dereference a static string Arne Vajhøj <arne@vajhoej.dk> - 2022-11-03 20:14 -0400
Re: How do I dereference a static string Arne Vajhøj <arne@vajhoej.dk> - 2022-11-03 19:29 -0400
csiph-web