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


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

Re: Assignment or Initialization?

Newsgroups comp.lang.java.programmer
Date 2016-02-03 05:14 -0800
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> <56b1e010$0$23816$e4fe514c@news.xs4all.nl>
Message-ID <4e1e454e-1e86-4915-8995-a98c86cc7bf7@googlegroups.com> (permalink)
Subject Re: Assignment or Initialization?
From Eric Douglas <e.d.programmer@gmail.com>

Show all headers | View raw


On Wednesday, February 3, 2016 at 6:10:32 AM UTC-5, Silvio wrote:
> Nonsense, that is just your wording. Even in functional languages where 
> variables are by definition constants people speak of single assignment.
> 
> You can argue that there is assignment and reassignment of values, the 
> latter of which is not allowed on final variables. But I do not think 
> the JLS uses this term.

Initialize is normally more for the first time a non-final variable gets assigned, like

public class Obj { 
private int val; 
public void init() {
val = Defaults.findFirstValue();
}
public void setVal(final int newval) { 
val = newval; 
} 
}

It could even technically not be the first value assigned, if perhaps your variable is an object and it's default value is a null before the init process, though the irrelevant semantics train may have run off the rails.

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