Path: csiph.com!weretis.net!feeder8.news.weretis.net!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Andreas Leitgeb Newsgroups: comp.lang.java.programmer Subject: Re: How do I dereference a static string Date: Thu, 3 Nov 2022 17:38:46 -0000 (UTC) Organization: A noiseless patient Spider Lines: 12 Message-ID: References: <282053db-e7b9-4f0a-a66c-12f53021fd55n@googlegroups.com> Reply-To: avl@logic.at Injection-Date: Thu, 3 Nov 2022 17:38:46 -0000 (UTC) Injection-Info: reader01.eternal-september.org; posting-host="824b9e953c48755bbdc4a584a2bda47e"; logging-data="1597125"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/tOEj24vq+qjJz2QapwYGC" User-Agent: slrn/1.0.3 (Linux) Cancel-Lock: sha1:U1kg2rwoqIsGrPSlFwAWBovEOh0= Xref: csiph.com comp.lang.java.programmer:39831 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? For what you're doing, "unreferencing" might be the better word. The word from subject "dereferencing" rather denotes access of the referenced thing, like in System.out.println(foo);