Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

[FORTRAN] will persist for some time -- probably for at least the next decade. -- T. Cheatham


devel / comp.lang.java.programmer / Re: How do I dereference a static string

SubjectAuthor
* How do I dereference a static stringC.D. Altenburg, Ph.D,
+- How do I dereference a static stringAndreas Leitgeb
+* How do I dereference a static stringe.d.pro...@gmail.com
|`- How do I dereference a static stringArne_Vajhøj
`- How do I dereference a static stringArne_Vajhøj

1
How do I dereference a static string

<282053db-e7b9-4f0a-a66c-12f53021fd55n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=471&group=comp.lang.java.programmer#471

  copy link   Newsgroups: comp.lang.java.programmer
X-Received: by 2002:a05:620a:12b5:b0:6fa:8a0c:ffd9 with SMTP id x21-20020a05620a12b500b006fa8a0cffd9mr11460qki.518.1667495109867;
Thu, 03 Nov 2022 10:05:09 -0700 (PDT)
X-Received: by 2002:a9d:5911:0:b0:657:a6bd:372c with SMTP id
t17-20020a9d5911000000b00657a6bd372cmr15904511oth.6.1667495109653; Thu, 03
Nov 2022 10:05:09 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.java.programmer
Date: Thu, 3 Nov 2022 10:05:09 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=2607:fb90:8e8e:3ac8:489c:976b:fc5d:70f9;
posting-account=kTs1ygoAAACgG1TSoyECpovEyy-V6_8b
NNTP-Posting-Host: 2607:fb90:8e8e:3ac8:489c:976b:fc5d:70f9
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <282053db-e7b9-4f0a-a66c-12f53021fd55n@googlegroups.com>
Subject: How do I dereference a static string
From: cdalten@gmail.com (C.D. Altenburg, Ph.D,)
Injection-Date: Thu, 03 Nov 2022 17:05:09 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1189
 by: C.D. Altenburg, Ph.D - Thu, 3 Nov 2022 17:05 UTC

Say I have the string

public static string foo = "foo";

can I just do

foo = null;

in order to dereference that string?

Re: How do I dereference a static string

<slrntm7v56.1qde.avl@logic.at>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=472&group=comp.lang.java.programmer#472

  copy link   Newsgroups: comp.lang.java.programmer
Path: i2pn2.org!i2pn.org!aioe.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: avl@logic.at (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: <slrntm7v56.1qde.avl@logic.at>
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=
 by: Andreas Leitgeb - Thu, 3 Nov 2022 17:38 UTC

C.D. Altenburg, Ph.D, <cdalten@gmail.com> 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);

Re: How do I dereference a static string

<240bceee-4aa9-4c13-85e7-de1946350bb4n@googlegroups.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=474&group=comp.lang.java.programmer#474

  copy link   Newsgroups: comp.lang.java.programmer
X-Received: by 2002:a37:b7c3:0:b0:6f7:65f6:a896 with SMTP id h186-20020a37b7c3000000b006f765f6a896mr22948505qkf.293.1667504267793;
Thu, 03 Nov 2022 12:37:47 -0700 (PDT)
X-Received: by 2002:a05:6830:6384:b0:661:bee5:73ce with SMTP id
ch4-20020a056830638400b00661bee573cemr15842600otb.343.1667504267497; Thu, 03
Nov 2022 12:37:47 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.java.programmer
Date: Thu, 3 Nov 2022 12:37:47 -0700 (PDT)
In-Reply-To: <282053db-e7b9-4f0a-a66c-12f53021fd55n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=98.237.40.232; posting-account=2czF5goAAAD4GBMPIGV4KcD2K4PhoB_H
NNTP-Posting-Host: 98.237.40.232
References: <282053db-e7b9-4f0a-a66c-12f53021fd55n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <240bceee-4aa9-4c13-85e7-de1946350bb4n@googlegroups.com>
Subject: Re: How do I dereference a static string
From: e.d.programmer@gmail.com (e.d.pro...@gmail.com)
Injection-Date: Thu, 03 Nov 2022 19:37:47 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1782
 by: e.d.pro...@gmail.com - Thu, 3 Nov 2022 19:37 UTC

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.
It is still possible but not advisable to have a public static variable which is not final. It's better to make it private static and use accessor methods.

Re: How do I dereference a static string

<tk1itd$n9b$1@gioia.aioe.org>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=476&group=comp.lang.java.programmer#476

  copy link   Newsgroups: comp.lang.java.programmer
Path: i2pn2.org!i2pn.org!aioe.org!LeVffQP25j5GAigzc2gaQA.user.46.165.242.75.POSTED!not-for-mail
From: arne@vajhoej.dk (Arne Vajhøj)
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>
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
 by: Arne Vajhøj - Thu, 3 Nov 2022 23:29 UTC

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

Re: How do I dereference a static string

<tk1lgv$1i5c$1@gioia.aioe.org>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=477&group=comp.lang.java.programmer#477

  copy link   Newsgroups: comp.lang.java.programmer
Path: i2pn2.org!i2pn.org!aioe.org!LeVffQP25j5GAigzc2gaQA.user.46.165.242.75.POSTED!not-for-mail
From: arne@vajhoej.dk (Arne Vajhøj)
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>
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
 by: Arne Vajhøj - Fri, 4 Nov 2022 00:14 UTC

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

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor