Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #39835

Re: How do I dereference a static string

Path csiph.com!news.mixmin.net!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 19:29:49 -0400
Organization Aioe.org NNTP Server
Message-ID <tk1itd$n9b$1@gioia.aioe.org> (permalink)
References <282053db-e7b9-4f0a-a66c-12f53021fd55n@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="23851"; 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:39835

Show key headers only | View raw


On 11/3/2022 1:05 PM, 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?

It is a valid statement.

But note that Java does not use reference
counting for memory management so setting
references to null when "done" is
very rare in Java (doing it when "ready"
is seen).

Arne

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Find similar | Unroll thread


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