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


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

Re: Assignment or Initialization?

Path csiph.com!aioe.org!.POSTED!not-for-mail
From Arne Vajhøj <arne@vajhoej.dk>
Newsgroups comp.lang.java.programmer
Subject Re: Assignment or Initialization?
Date Tue, 2 Feb 2016 18:13:39 -0500
Organization Aioe.org NNTP Server
Lines 38
Message-ID <n8rd72$1vp2$1@gioia.aioe.org> (permalink)
References <assignment-20160201130855@ram.dialup.fu-berlin.de> <n8oa1b$tq9$2@dont-email.me> <n8p2a4$8jg$1@gioia.aioe.org> <n8qvt2$qv6$4@dont-email.me>
NNTP-Posting-Host ANasIS7Js9OyLQwgloeBLQ.user.gioia.aioe.org
Mime-Version 1.0
Content-Type text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding 8bit
X-Complaints-To abuse@aioe.org
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1
X-Notice Filtered by postfilter v. 0.8.2
Xref csiph.com comp.lang.java.programmer:33570

Show key headers only | View raw


On 2/2/2016 2:29 PM, 4ndre4 wrote:
> On 02/02/2016 01:55, Arne Vajhøj wrote:
>
> [...]
>>>                                     You can't declare a final variable
>>> and THEN assign a value to it, unless you are in a constructor, in which
>>> case it's still an initialization.
>>
>> No. That is not how Java is.
>>
>> In fact the JLS section about final start with:
>>
>> "Once a final variable has been assigned, it always contains the same
>> value."
>>
>> so final variables do get assigned (in Java terminology).
>
> Although you are right on the first point - you can indeed declare a
> final variable and then assing a value to it, the question of the OP was
> around initialization vs. assignment. I see the first assignment to a
> final variable as an initialization, not an assignment. If we consider
> the question in those terms, you can't really assign a value to a final
> variable, you can only initialize it.
>
>  >so final variables do get assigned
>
> No, they get initialized.

I quoted the Java Language specification for calling it assignment.

So let me ask you: do you not believe it is correctly quoted or do you
consider your opinion to take precedence over the language
specification regarding what is the correct terminology????

Arne


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


Thread

Re: Assignment or Initialization? 4ndre4 <4ndre4@4ndre4.com.invalid> - 2016-02-01 19:03 +0000
  Re: Assignment or Initialization? Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-02-01 14:47 -0500
    Re: Assignment or Initialization? Knute Johnson <nospam@rabbitbrush.frazmtn.com> - 2016-02-01 12:31 -0800
      Re: Assignment or Initialization? Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-02-01 16:03 -0500
        Re: Assignment or Initialization? Jerry Stuckle <jstucklex@attglobal.net> - 2016-02-01 19:52 -0500
          Re: Assignment or Initialization? Arne Vajhøj <arne@vajhoej.dk> - 2016-02-01 20:46 -0500
          Re: Assignment or Initialization? Wayne <nospam@all.invalid> - 2016-02-01 23:39 -0500
            Re: Assignment or Initialization? Jerry Stuckle <jstucklex@attglobal.net> - 2016-02-02 09:14 -0500
      Re: Assignment or Initialization? 4ndre4 <4ndre4@4ndre4.com.invalid> - 2016-02-02 19:25 +0000
  Re: Assignment or Initialization? Eric Douglas <e.d.programmer@gmail.com> - 2016-02-01 13:13 -0800
    Re: Assignment or Initialization? 4ndre4 <4ndre4@4ndre4.com.invalid> - 2016-02-02 19:26 +0000
  Re: Assignment or Initialization? Arne Vajhøj <arne@vajhoej.dk> - 2016-02-01 20:55 -0500
    Re: Assignment or Initialization? 4ndre4 <4ndre4@4ndre4.com.invalid> - 2016-02-02 19:29 +0000
      Re: Assignment or Initialization? Eric Douglas <e.d.programmer@gmail.com> - 2016-02-02 11:44 -0800
        Re: Assignment or Initialization? Lew <lewbloch@gmail.com> - 2016-02-02 13:16 -0800
      Re: Assignment or Initialization? Lew <lewbloch@gmail.com> - 2016-02-02 13:15 -0800
      Re: Assignment or Initialization? Arne Vajhøj <arne@vajhoej.dk> - 2016-02-02 18:13 -0500
      Re: Assignment or Initialization? Silvio <silvio@internet.com> - 2016-02-03 12:10 +0100
        Re: Assignment or Initialization? Eric Douglas <e.d.programmer@gmail.com> - 2016-02-03 05:14 -0800
          Re: Assignment or Initialization? Lew <lewbloch@gmail.com> - 2016-02-03 13:39 -0800
  Re: Assignment or Initialization? Lew <lewbloch@gmail.com> - 2016-02-02 10:32 -0800
    Re: Assignment or Initialization? 4ndre4 <4ndre4@4ndre4.com.invalid> - 2016-02-02 19:22 +0000
  Re: Assignment or Initialization? Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2016-02-03 09:03 -0800

csiph-web