X-Received: by 10.224.207.2 with SMTP id fw2mr6897480qab.6.1365797668225; Fri, 12 Apr 2013 13:14:28 -0700 (PDT) X-Received: by 10.182.104.228 with SMTP id gh4mr246076obb.27.1365797668117; Fri, 12 Apr 2013 13:14:28 -0700 (PDT) Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!ca1no42829189qab.0!news-out.google.com!ef9ni31353qab.0!nntp.google.com!ca1no42829178qab.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.java.programmer Date: Fri, 12 Apr 2013 13:14:27 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=69.28.149.29; posting-account=CP-lKQoAAAAGtB5diOuGlDQk0jIwmH0T NNTP-Posting-Host: 69.28.149.29 References: <19un43xj77bua.vw45l4e2wshi.dlg@40tude.net> <7f128eff-7ea1-4cfd-9147-f57af28c931d@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Inserting In a List From: Lew Injection-Date: Fri, 12 Apr 2013 20:14:28 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: csiph.com comp.lang.java.programmer:23435 Wanja Gayk wrote: > Lew says... >> Wanja Gayk wrote: >>> I do find the term "final variable" a bit clumsy though, because in my= =20 >>> view these are constants. Unfortunately in the Java world, we're callin= g=20 >>> these "constants" only, if they're marked "static". Technically that's= =20 >=20 >> That is not correct Java terminology. There is nothing in the Java defin= ition=20 >> of "constant expression" or "constant variable" that requires a static c= ontext. >=20 >> http://docs.oracle.com/javase/specs/jls/se7/html/jls-15.html#jls-15.28 >>=20 >> http://docs.oracle.com/javase/specs/jls/se7/html/jls-4.html#jls-4.12.4 >> "A variable of primitive type or type String, that is final and initiali= zed with a > compile-time constant expression (=A715.28), is called a constant variabl= e.">=20 >=20 > Well, Lew, I guess you pretty much understand what I mean, it's the same = thing. I understood you to mean that to be called a "constant" in Java that the th= ing would=20 have to be static. That is not the same thing at all. > The term "constant variable" is a moronic oxymoron, it can be=20 Regardless of your emotional reaction to the term, that is the term. > either variable or constant. It's like saying "I have a fixed movable=20 The word "variable" in computer science does not mean "can vary". It means= =20 "a named location that can hold a value." > device" - no, you haven't, you have a fixed device, by fixing it you=20 > have removed the "movable" nature entirely. It's nothing like that at all. You yourself make this clear in another post: Wanja Gayk wrote: > "lipska the kat" says...=20 >> This is what I don't get, if it's a named bin that can be refilled why= =20 >> do you _decorate_ it with final.=20 > > It's because it is not meant to be refilled, ever, that's what you call= =20 > a constant.=20 You are arguing both sides of the fence. >> It does not say "final, static and ...". >=20 > I might be used to the terminology used in the Eclipse IDE when you use= =20 > the refactoring "extract constant" you'll get a static final field. "Extract constant" in Eclipse as a refactoring action does indeed extract t= o a=20 static constant variable. That does not mean that static variables are the only ones that can be cons= tant. It just means that the wizard implements the common use case. --=20 Lew