Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #23175 > unrolled thread
| Started by | subhabangalore@gmail.com |
|---|---|
| First post | 2013-04-02 03:11 -0700 |
| Last post | 2013-04-03 10:35 +0100 |
| Articles | 20 on this page of 161 — 18 participants |
Back to article view | Back to comp.lang.java.programmer
Inserting In a List subhabangalore@gmail.com - 2013-04-02 03:11 -0700
Re: Inserting In a List Roedy Green <see_website@mindprod.com.invalid> - 2013-04-02 03:59 -0700
Re: Inserting In a List Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-04-02 08:27 -0300
Re: Inserting In a List Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-04-02 08:59 -0300
Re: Inserting In a List Martin Gregorie <martin@address-in-sig.invalid> - 2013-04-02 21:06 +0000
Re: Inserting In a List Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-04-02 18:22 -0400
Re: Inserting In a List Martin Gregorie <martin@address-in-sig.invalid> - 2013-04-02 22:52 +0000
Re: Inserting In a List Joerg Meier <joergmmeier@arcor.de> - 2013-04-03 02:04 +0200
Re: Inserting In a List Arne Vajhøj <arne@vajhoej.dk> - 2013-04-02 20:20 -0400
Re: Inserting In a List Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-04-02 21:03 -0400
Re: Inserting In a List Arne Vajhøj <arne@vajhoej.dk> - 2013-04-02 21:26 -0400
Re: Inserting In a List Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-04-02 22:29 -0400
Re: Inserting In a List Arne Vajhøj <arne@vajhoej.dk> - 2013-04-03 20:16 -0400
Re: Inserting In a List Joshua Cranmer 🐧 <Pidgeot18@verizon.invalid> - 2013-04-02 20:26 -0500
Re: Inserting In a List Arne Vajhøj <arne@vajhoej.dk> - 2013-04-02 21:29 -0400
Re: Inserting In a List Joerg Meier <joergmmeier@arcor.de> - 2013-04-04 14:07 +0200
Re: Inserting In a List Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-04-03 05:45 -0300
Re: Inserting In a List Joerg Meier <joergmmeier@arcor.de> - 2013-04-03 15:26 +0200
Re: Inserting In a List Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-04-03 18:09 -0300
Re: Inserting In a List Joerg Meier <joergmmeier@arcor.de> - 2013-04-04 00:54 +0200
Re: Inserting In a List Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-04-03 20:30 -0300
Re: Inserting In a List Joerg Meier <joergmmeier@arcor.de> - 2013-04-04 01:35 +0200
Re: Inserting In a List Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-04-03 20:55 -0300
Re: Inserting In a List Joerg Meier <joergmmeier@arcor.de> - 2013-04-04 02:00 +0200
Re: Inserting In a List Arne Vajhøj <arne@vajhoej.dk> - 2013-04-03 19:49 -0400
Re: Inserting In a List Martin Gregorie <martin@address-in-sig.invalid> - 2013-04-03 22:43 +0000
Re: Inserting In a List Joerg Meier <joergmmeier@arcor.de> - 2013-04-04 01:08 +0200
Re: Inserting In a List Martin Gregorie <martin@address-in-sig.invalid> - 2013-04-04 00:42 +0000
Re: Inserting In a List Joerg Meier <joergmmeier@arcor.de> - 2013-04-04 14:12 +0200
Re: Inserting In a List Martin Gregorie <martin@address-in-sig.invalid> - 2013-04-04 21:47 +0000
Re: Inserting In a List Joerg Meier <joergmmeier@arcor.de> - 2013-04-05 00:36 +0200
Re: Inserting In a List Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-04-02 21:08 -0400
Re: Inserting In a List Martin Gregorie <martin@address-in-sig.invalid> - 2013-04-03 22:37 +0000
Re: Inserting In a List Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-04-03 20:50 -0400
Re: Inserting In a List Joerg Meier <joergmmeier@arcor.de> - 2013-04-02 14:35 +0200
Re: Inserting In a List lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-04-02 15:08 +0100
Usefulness of "final" (Was: Re: Inserting In a List) Robert Klemme <shortcutter@googlemail.com> - 2013-04-02 21:06 +0200
Re: Usefulness of "final" (Was: Re: Inserting In a List) Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-04-02 16:41 -0400
Re: Usefulness of "final" (Was: Re: Inserting In a List) Robert Klemme <shortcutter@googlemail.com> - 2013-04-03 08:09 +0200
Re: Usefulness of "final" (Was: Re: Inserting In a List) Arne Vajhøj <arne@vajhoej.dk> - 2013-04-03 20:13 -0400
Re: Usefulness of "final" (Was: Re: Inserting In a List) Arne Vajhøj <arne@vajhoej.dk> - 2013-04-02 20:08 -0400
Re: Usefulness of "final" (Was: Re: Inserting In a List) lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-04-03 11:15 +0100
Re: Usefulness of "final" (Was: Re: Inserting In a List) Robert Klemme <shortcutter@googlemail.com> - 2013-04-03 19:08 +0200
Re: Usefulness of "final" (Was: Re: Inserting In a List) lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-04-03 19:51 +0100
Re: Usefulness of "final" (Was: Re: Inserting In a List) Joerg Meier <joergmmeier@arcor.de> - 2013-04-03 21:01 +0200
Re: Usefulness of "final" (Was: Re: Inserting In a List) markspace <markspace@nospam.nospam> - 2013-04-03 14:15 -0700
Re: Usefulness of "final" (Was: Re: Inserting In a List) Arne Vajhøj <arne@vajhoej.dk> - 2013-04-03 18:22 -0400
Re: Usefulness of "final" (Was: Re: Inserting In a List) markspace <markspace@nospam.nospam> - 2013-04-03 15:41 -0700
Re: Usefulness of "final" (Was: Re: Inserting In a List) Arne Vajhøj <arne@vajhoej.dk> - 2013-04-03 19:56 -0400
Re: Usefulness of "final" (Was: Re: Inserting In a List) markspace <markspace@nospam.nospam> - 2013-04-03 16:58 -0700
Re: Usefulness of "final" (Was: Re: Inserting In a List) Arne Vajhøj <arne@vajhoej.dk> - 2013-04-03 20:08 -0400
Re: Usefulness of "final" (Was: Re: Inserting In a List) markspace <markspace@nospam.nospam> - 2013-04-03 17:21 -0700
Re: Usefulness of "final" (Was: Re: Inserting In a List) Arne Vajhøj <arne@vajhoej.dk> - 2013-04-03 20:27 -0400
Re: Usefulness of "final" (Was: Re: Inserting In a List) markspace <markspace@nospam.nospam> - 2013-04-03 17:34 -0700
Re: Usefulness of "final" (Was: Re: Inserting In a List) Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-04-03 21:20 -0400
Re: Usefulness of "final" (Was: Re: Inserting In a List) markspace <markspace@nospam.nospam> - 2013-04-03 19:17 -0700
Re: Usefulness of "final" (Was: Re: Inserting In a List) Lew <lewbloch@gmail.com> - 2013-04-03 20:45 -0700
Re: Usefulness of "final" (Was: Re: Inserting In a List) markspace <markspace@nospam.nospam> - 2013-04-03 21:30 -0700
Re: Usefulness of "final" (Was: Re: Inserting In a List) Joerg Meier <joergmmeier@arcor.de> - 2013-04-04 14:34 +0200
Re: Usefulness of "final" (Was: Re: Inserting In a List) markspace <markspace@nospam.nospam> - 2013-04-04 09:52 -0700
Re: Usefulness of "final" (Was: Re: Inserting In a List) Joerg Meier <joergmmeier@arcor.de> - 2013-04-05 00:39 +0200
Re: Usefulness of "final" (Was: Re: Inserting In a List) Robert Klemme <shortcutter@googlemail.com> - 2013-04-04 19:50 +0200
Re: Usefulness of "final" (Was: Re: Inserting In a List) Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-04-04 08:27 -0400
Re: Usefulness of "final" (Was: Re: Inserting In a List) markspace <markspace@nospam.nospam> - 2013-04-04 09:47 -0700
Re: Usefulness of "final" (Was: Re: Inserting In a List) Robert Klemme <shortcutter@googlemail.com> - 2013-04-04 19:44 +0200
Re: Usefulness of "final" (Was: Re: Inserting In a List) markspace <markspace@nospam.nospam> - 2013-04-04 11:08 -0700
Re: Usefulness of "final" (Was: Re: Inserting In a List) Robert Klemme <shortcutter@googlemail.com> - 2013-04-04 22:53 +0200
Re: Usefulness of "final" (Was: Re: Inserting In a List) markspace <markspace@nospam.nospam> - 2013-04-04 14:29 -0700
Re: Usefulness of "final" (Was: Re: Inserting In a List) Robert Klemme <shortcutter@googlemail.com> - 2013-04-05 21:54 +0200
Re: Usefulness of "final" (Was: Re: Inserting In a List) lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-04-04 19:48 +0100
Re: Usefulness of "final" (Was: Re: Inserting In a List) Arne Vajhøj <arne@vajhoej.dk> - 2013-04-03 20:05 -0400
Re: Usefulness of "final" (Was: Re: Inserting In a List) markspace <markspace@nospam.nospam> - 2013-04-03 17:24 -0700
Re: Usefulness of "final" (Was: Re: Inserting In a List) Arne Vajhøj <arne@vajhoej.dk> - 2013-04-03 20:32 -0400
Re: Usefulness of "final" (Was: Re: Inserting In a List) markspace <markspace@nospam.nospam> - 2013-04-03 18:34 -0700
Re: Usefulness of "final" (Was: Re: Inserting In a List) Arne Vajhøj <arne@vajhoej.dk> - 2013-04-03 21:54 -0400
Re: Usefulness of "final" (Was: Re: Inserting In a List) Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-04-03 21:25 -0400
Re: Usefulness of "final" (Was: Re: Inserting In a List) markspace <markspace@nospam.nospam> - 2013-04-03 18:37 -0700
Re: Usefulness of "final" (Was: Re: Inserting In a List) Arne Vajhøj <arne@vajhoej.dk> - 2013-04-03 21:57 -0400
Re: Usefulness of "final" (Was: Re: Inserting In a List) markspace <markspace@nospam.nospam> - 2013-04-03 19:23 -0700
Re: Usefulness of "final" (Was: Re: Inserting In a List) Wanja Gayk <brixomatic@yahoo.com> - 2013-04-06 21:58 +0200
Re: Usefulness of "final" (Was: Re: Inserting In a List) markspace <markspace@nospam.nospam> - 2013-04-06 17:19 -0700
Re: Usefulness of "final" (Was: Re: Inserting In a List) Wanja Gayk <brixomatic@yahoo.com> - 2013-04-07 17:28 +0200
Re: Usefulness of "final" (Was: Re: Inserting In a List) markspace <markspace@nospam.nospam> - 2013-04-07 09:02 -0700
Re: Usefulness of "final" (Was: Re: Inserting In a List) Wanja Gayk <brixomatic@yahoo.com> - 2013-04-07 19:20 +0200
Re: Usefulness of "final" (Was: Re: Inserting In a List) Wanja Gayk <brixomatic@yahoo.com> - 2013-04-07 19:24 +0200
Re: Usefulness of "final" (Was: Re: Inserting In a List) Lew <lewbloch@gmail.com> - 2013-04-03 18:41 -0700
Re: Usefulness of "final" (Was: Re: Inserting In a List) Lew <lewbloch@gmail.com> - 2013-04-03 18:31 -0700
Re: Usefulness of "final" (Was: Re: Inserting In a List) markspace <markspace@nospam.nospam> - 2013-04-03 18:46 -0700
Re: Usefulness of "final" (Was: Re: Inserting In a List) Lew <lewbloch@gmail.com> - 2013-04-03 20:09 -0700
Re: Usefulness of "final" (Was: Re: Inserting In a List) markspace <markspace@nospam.nospam> - 2013-04-03 20:47 -0700
Re: Usefulness of "final" Leif Roar Moldskred <leifm@dimnakorr.com> - 2013-04-04 00:42 -0500
Re: Usefulness of "final" paul.cager@gmail.com - 2013-04-04 01:55 -0700
Re: Usefulness of "final" Joerg Meier <joergmmeier@arcor.de> - 2013-04-04 14:45 +0200
Re: Usefulness of "final" (Was: Re: Inserting In a List) Joerg Meier <joergmmeier@arcor.de> - 2013-04-04 00:46 +0200
Re: Usefulness of "final" (Was: Re: Inserting In a List) markspace <markspace@nospam.nospam> - 2013-04-03 16:10 -0700
Re: Usefulness of "final" (Was: Re: Inserting In a List) Joerg Meier <joergmmeier@arcor.de> - 2013-04-04 01:25 +0200
Re: Usefulness of "final" (Was: Re: Inserting In a List) markspace <markspace@nospam.nospam> - 2013-04-03 16:44 -0700
Re: Usefulness of "final" (Was: Re: Inserting In a List) Joerg Meier <joergmmeier@arcor.de> - 2013-04-04 01:57 +0200
Re: Usefulness of "final" (Was: Re: Inserting In a List) markspace <markspace@nospam.nospam> - 2013-04-03 17:19 -0700
Re: Usefulness of "final" (Was: Re: Inserting In a List) Joerg Meier <joergmmeier@arcor.de> - 2013-04-04 14:35 +0200
Re: Usefulness of "final" (Was: Re: Inserting In a List) markspace <markspace@nospam.nospam> - 2013-04-04 10:34 -0700
Re: Usefulness of "final" (Was: Re: Inserting In a List) Joerg Meier <joergmmeier@arcor.de> - 2013-04-05 00:43 +0200
Re: Usefulness of "final" (Was: Re: Inserting In a List) markspace <markspace@nospam.nospam> - 2013-04-04 16:22 -0700
Re: Usefulness of "final" (Was: Re: Inserting In a List) Lew <lewbloch@gmail.com> - 2013-04-04 16:49 -0700
Re: Usefulness of "final" (Was: Re: Inserting In a List) markspace <markspace@nospam.nospam> - 2013-04-04 18:21 -0700
Re: Usefulness of "final" (Was: Re: Inserting In a List) Lew <lewbloch@gmail.com> - 2013-04-04 18:49 -0700
Re: Usefulness of "final" (Was: Re: Inserting In a List) Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-04-05 05:30 -0300
Re: Usefulness of "final" (Was: Re: Inserting In a List) Arne Vajhøj <arne@vajhoej.dk> - 2013-04-03 20:10 -0400
Re: Usefulness of "final" (Was: Re: Inserting In a List) markspace <markspace@nospam.nospam> - 2013-04-03 17:29 -0700
Re: Usefulness of "final" (Was: Re: Inserting In a List) Joerg Meier <joergmmeier@arcor.de> - 2013-04-04 02:53 +0200
Re: Usefulness of "final" (Was: Re: Inserting In a List) Jim Janney <jjanney@shell.xmission.com> - 2013-04-04 13:51 -0600
Re: Usefulness of "final" (Was: Re: Inserting In a List) Robert Klemme <shortcutter@googlemail.com> - 2013-04-06 13:31 +0200
Re: Usefulness of "final" (Was: Re: Inserting In a List) markspace <markspace@nospam.nospam> - 2013-04-06 10:50 -0700
Re: Usefulness of "final" (Was: Re: Inserting In a List) lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-04-04 09:09 +0100
Re: Usefulness of "final" (Was: Re: Inserting In a List) Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-04-04 05:37 -0300
Re: Usefulness of "final" (Was: Re: Inserting In a List) Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-04-04 06:10 -0300
Re: Usefulness of "final" (Was: Re: Inserting In a List) Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-04-04 19:40 -0300
Re: arrays and variables Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-04-05 05:44 -0300
Re: arrays and variables lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-04-05 14:08 +0100
Re: arrays and variables Lew <lewbloch@gmail.com> - 2013-04-05 13:33 -0700
Re: arrays and variables lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-04-06 09:11 +0100
Re: arrays and variables Robert Klemme <shortcutter@googlemail.com> - 2013-04-06 15:20 +0200
Re: arrays and variables lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-04-06 16:25 +0100
Re: arrays and variables Robert Klemme <shortcutter@googlemail.com> - 2013-04-06 17:50 +0200
Re: arrays and variables lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-04-06 18:13 +0100
Re: arrays and variables Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-04-06 14:32 -0300
Re: arrays and variables Robert Klemme <shortcutter@googlemail.com> - 2013-04-06 15:02 +0200
Re: arrays and variables Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-04-05 22:12 -0300
Re: Usefulness of "final" (Was: Re: Inserting In a List) lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-04-04 10:35 +0100
Re: Usefulness of "final" (Was: Re: Inserting In a List) Joerg Meier <joergmmeier@arcor.de> - 2013-04-04 14:02 +0200
Re: Usefulness of "final" (Was: Re: Inserting In a List) lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-04-04 13:41 +0100
Re: Usefulness of "final" (Was: Re: Inserting In a List) Joerg Meier <joergmmeier@arcor.de> - 2013-04-04 13:53 +0200
Re: Usefulness of "final" (Was: Re: Inserting In a List) Robert Klemme <shortcutter@googlemail.com> - 2013-04-03 23:05 +0200
Re: Inserting In a List Joerg Meier <joergmmeier@arcor.de> - 2013-04-02 22:09 +0200
Re: Inserting In a List Arne Vajhøj <arne@vajhoej.dk> - 2013-04-02 20:03 -0400
Re: Inserting In a List Wanja Gayk <brixomatic@yahoo.com> - 2013-04-06 21:39 +0200
Re: Inserting In a List Robert Klemme <shortcutter@googlemail.com> - 2013-04-07 01:08 +0200
Re: Inserting In a List Lew <lewbloch@gmail.com> - 2013-04-06 22:15 -0700
Re: Inserting In a List lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-04-07 08:48 +0100
Re: Inserting In a List Lew <lewbloch@gmail.com> - 2013-04-07 12:32 -0700
Re: Inserting In a List "John B. Matthews" <nospam@nospam.invalid> - 2013-04-07 21:06 -0400
Re: Inserting In a List lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-04-08 08:40 +0100
Re: Inserting In a List lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-04-07 08:55 +0100
Re: Inserting In a List Wanja Gayk <brixomatic@yahoo.com> - 2013-04-07 17:54 +0200
Re: Inserting In a List lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-04-07 19:53 +0100
Re: Inserting In a List Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-04-07 17:58 -0300
Re: Inserting In a List Robert Klemme <shortcutter@googlemail.com> - 2013-04-08 08:28 +0200
Re: Inserting In a List lipska the kat <"nospam at neversurrender dot co dot uk"> - 2013-04-08 08:54 +0100
Re: Inserting In a List Robert Klemme <shortcutter@googlemail.com> - 2013-04-08 19:13 +0200
Re: Inserting In a List Wanja Gayk <brixomatic@yahoo.com> - 2013-04-12 20:58 +0200
Re: Inserting In a List Lew <lewbloch@gmail.com> - 2013-04-12 13:17 -0700
Re: Inserting In a List Lew <lewbloch@gmail.com> - 2013-04-07 12:40 -0700
Re: Inserting In a List Wanja Gayk <brixomatic@yahoo.com> - 2013-04-12 20:47 +0200
Re: Inserting In a List Lew <lewbloch@gmail.com> - 2013-04-12 13:14 -0700
Re: Inserting In a List Steven Simpson <ss@domain.invalid> - 2013-04-02 13:53 +0100
Re: Inserting In a List Roedy Green <see_website@mindprod.com.invalid> - 2013-04-02 07:10 -0700
Re: Inserting In a List Lew <lewbloch@gmail.com> - 2013-04-02 10:46 -0700
Re: Inserting In a List markspace <markspace@nospam.nospam> - 2013-04-02 11:28 -0700
Re: Inserting In a List Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-04-02 16:00 -0400
Re: Inserting In a List subhabangalore@gmail.com - 2013-04-03 01:47 -0700
Re: Inserting In a List Steven Simpson <ss@domain.invalid> - 2013-04-03 10:35 +0100
Page 8 of 9 — ← Prev page 1 2 3 4 5 6 7 [8] 9 Next page →
| From | "John B. Matthews" <nospam@nospam.invalid> |
|---|---|
| Date | 2013-04-07 21:06 -0400 |
| Message-ID | <nospam-1A5C7E.21065207042013@news.aioe.org> |
| In reply to | #23370 |
In article <230151f0-533f-48d3-a4df-413f69444a33@googlegroups.com>, Lew <lewbloch@gmail.com> wrote: > http://www.oracle.com/technetwork/java/effectivejava-136174.html See also the old Sun Developer Network page: <http://192.9.162.55/docs/books/effective/> -- John B. Matthews trashgod at gmail dot com <http://sites.google.com/site/drjohnbmatthews>
[toc] | [prev] | [next] | [standalone]
| From | lipska the kat <"nospam at neversurrender dot co dot uk"> |
|---|---|
| Date | 2013-04-08 08:40 +0100 |
| Message-ID | <sb6dndPa7prj6f_MnZ2dnUVZ8smdnZ2d@bt.com> |
| In reply to | #23370 |
On 07/04/13 20:32, Lew wrote: > lipska the kat wrote: >> Lew wrote: >>> As Bloch says, you should design for heritability or prevent it. >> >> Huh! This is getting surreal, who is Bloch, it's you, at least I thought >> it was, you're messing with my head, stop it. > > Really? You are joking, no doubt, but just in case you aren't: > > http://www.oracle.com/technetwork/java/effectivejava-136174.html > of course. > > Your head is of no concern to me. Oh My God there's two of them. Does a pair of Blo[t]ches make a rash? Jeez, they're spreading like a rash, nappy rash maybe. Now where did I put the Sudocrem? Only kidding (maybe) :-) lipska -- Lipska the Kat©: Troll hunter, sandbox destroyer and farscape dreamer of Aeryn Sun
[toc] | [prev] | [next] | [standalone]
| From | lipska the kat <"nospam at neversurrender dot co dot uk"> |
|---|---|
| Date | 2013-04-07 08:55 +0100 |
| Message-ID | <mtGdnagnNJrBu_zMnZ2dnUVZ8jqdnZ2d@bt.com> |
| In reply to | #23353 |
On 06/04/13 20:39, Wanja Gayk wrote: > In article <ntKdnSTV5a3le8fMnZ2dnUVZ8kmdnZ2d@bt.com>, lipska the kat > (lipska the kat) says... > >> Just as a matter of interest what's with all the finals >> >> particularly >> >> for (final File name : folder.listFiles()) >> >> Despite initial appearances this is indeed legal as the >> assignment is made multiple times but from the same statement. >> >> Given that the final keyword is, aside from a flag to the compiler for >> possible optimization, largely documentary, what is the point of making >> name final. >> >> In fact what does peppering the code with finals do to make it easily >> understandable to an inexperienced developer ? > > In my opinion it's been an unfortunate decision to have a "final" > keyword instead of a "var" keyword with a "final" default. > > Now, I'm a fan of using the "final" keyword everywhere possible apart > from method and class declarations and I'll give you my reasons behind > it. Your arguments are fair and represent your view of things. This is fine, however I have a question for you. Without getting all *philosophical* about it, what do you think the point of a variable is? lipska -- Lipska the Kat©: Troll hunter, sandbox destroyer and farscape dreamer of Aeryn Sun
[toc] | [prev] | [next] | [standalone]
| From | Wanja Gayk <brixomatic@yahoo.com> |
|---|---|
| Date | 2013-04-07 17:54 +0200 |
| Message-ID | <MPG.2bcbb4e53cffde04989756@202.177.16.121> |
| In reply to | #23360 |
In article <mtGdnagnNJrBu_zMnZ2dnUVZ8jqdnZ2d@bt.com>, lipska the kat (lipska the kat) says... > >> In fact what does peppering the code with finals do to make it easily > >> understandable to an inexperienced developer ? > > > > In my opinion it's been an unfortunate decision to have a "final" > > keyword instead of a "var" keyword with a "final" default. > > > > Now, I'm a fan of using the "final" keyword everywhere possible apart > > from method and class declarations and I'll give you my reasons behind > > it. > > Your arguments are fair and represent your view of things. > This is fine, however I have a question for you. > > Without getting all *philosophical* about it, > what do you think the point of a variable is? Depends if you're looking at it from a functional point of view or an imperative point of view. From the functional point of view, I'd say it represents a value that is defined by (parts of) the rest of the equation. From an imperative point of view I'd describe it as a named bin that can be refilled with a value. I do find the term "final variable" a bit clumsy though, because in my view these are constants. Unfortunately in the Java world, we're calling these "constants" only, if they're marked "static". Technically that's rather unfortunate, as these are just as "constant" as their non static sisters - they're just forcibly the same for a wider scope (that of the class loader). I guess naming these "final" instead of "const" was a result of not wanting to confuse C-programmers, I think "const" would have been the better name. Kind regards, Wanja -- ..Alesi's problem was that the back of the car was jumping up and down dangerously - and I can assure you from having been teammate to Jean Alesi and knowing what kind of cars that he can pull up with, when Jean Alesi says that a car is dangerous - it is. [Jonathan Palmer] --- news://freenews.netfront.net/ - complaints: news@netfront.net ---
[toc] | [prev] | [next] | [standalone]
| From | lipska the kat <"nospam at neversurrender dot co dot uk"> |
|---|---|
| Date | 2013-04-07 19:53 +0100 |
| Message-ID | <8MWdnbEIVKIMXfzMnZ2dnUVZ8tednZ2d@bt.com> |
| In reply to | #23364 |
On 07/04/13 16:54, Wanja Gayk wrote: > In article <mtGdnagnNJrBu_zMnZ2dnUVZ8jqdnZ2d@bt.com>, lipska the kat > (lipska the kat) says... > >>>> In fact what does peppering the code with finals do to make it > easily >>>> understandable to an inexperienced developer ? >>> >>> In my opinion it's been an unfortunate decision to have a "final" >>> keyword instead of a "var" keyword with a "final" default. >>> >>> Now, I'm a fan of using the "final" keyword everywhere possible apart >>> from method and class declarations and I'll give you my reasons behind >>> it. >> >> Your arguments are fair and represent your view of things. >> This is fine, however I have a question for you. >> >> Without getting all *philosophical* about it, >> what do you think the point of a variable is? > > Depends if you're looking at it from a functional point of view or an > imperative point of view. Well Java is an imperative language so let's go with that. > From an imperative point of view I'd describe it as a named bin that can > be refilled with a value. This is what I don't get, if it's a named bin that can be refilled why do you _decorate_ it with final. I'm probably not the most experienced developer here, 15 years and counting with Java but I've done everything from Swing based desktop stuff (yuk) to back end business applications that are presentation layer agnostic, to state machines that communicate with hardware devices and apart from one particular instance I can't think of a single time that I have ever had to use final more than once or twice in a component. Most components don't use it at all. What are you guys *doing* that you feel the need to modify all your variables with final everywhere. The whole point of a computer is to transform it's input to some useful output, you store your input, transform it (by updating variables usually) and emit it in a way that makes sense at that time. If you want a functional language use Haskell (or whatever). I may be missing something here but are you sure you are using the right language? :-) lipska -- Lipska the Kat©: Troll hunter, sandbox destroyer and farscape dreamer of Aeryn Sun
[toc] | [prev] | [next] | [standalone]
| From | Arved Sandstrom <asandstrom2@eastlink.ca> |
|---|---|
| Date | 2013-04-07 17:58 -0300 |
| Message-ID | <s5l8t.185598$m21.170897@newsfe02.iad> |
| In reply to | #23369 |
On 04/07/2013 03:53 PM, lipska the kat wrote: > On 07/04/13 16:54, Wanja Gayk wrote: >> In article <mtGdnagnNJrBu_zMnZ2dnUVZ8jqdnZ2d@bt.com>, lipska the kat >> (lipska the kat) says... >> >>>>> In fact what does peppering the code with finals do to make it >> easily >>>>> understandable to an inexperienced developer ? >>>> >>>> In my opinion it's been an unfortunate decision to have a "final" >>>> keyword instead of a "var" keyword with a "final" default. >>>> >>>> Now, I'm a fan of using the "final" keyword everywhere possible apart >>>> from method and class declarations and I'll give you my reasons behind >>>> it. >>> >>> Your arguments are fair and represent your view of things. >>> This is fine, however I have a question for you. >>> >>> Without getting all *philosophical* about it, >>> what do you think the point of a variable is? >> >> Depends if you're looking at it from a functional point of view or an >> imperative point of view. > > Well Java is an imperative language so let's go with that. > >> From an imperative point of view I'd describe it as a named bin that can >> be refilled with a value. > > This is what I don't get, if it's a named bin that can be refilled why > do you _decorate_ it with final. > > I'm probably not the most experienced developer here, 15 years and > counting with Java but I've done everything from Swing based desktop > stuff (yuk) to back end business applications that are presentation > layer agnostic, to state machines that communicate with hardware devices > and apart from one particular instance I can't think of a single time > that I have ever had to use final more than once or twice in a > component. Most components don't use it at all. What are you guys > *doing* that you feel the need to modify all your variables with final > everywhere. The whole point of a computer is to transform it's input to > some useful output, you store your input, transform it (by updating > variables usually) and emit it in a way that makes sense at that time. > If you want a functional language use Haskell (or whatever). > > I may be missing something here but are you sure you are using the right > language? :-) > > lipska > Controlling the scope and extent of a variable is something you absolutely want to do in imperative languages. One major reason for doing that is to understand what can modify the variable, and to keep those influences limited and manageable. Logical extensions to that thinking - entirely logical in imperative, not just in functional, programming - are to freeze the *variable* using 'final', so that you've got single assignment, or to freeze the *value* using either object immutability (or const objects in languages that support it). Or both. I think you're exaggerating by implying that people feel the need to make practically everything final. No, you make final what you expect ought to be a read-only variable in its scope. AHS
[toc] | [prev] | [next] | [standalone]
| From | Robert Klemme <shortcutter@googlemail.com> |
|---|---|
| Date | 2013-04-08 08:28 +0200 |
| Message-ID | <asf6d5FhgbmU1@mid.individual.net> |
| In reply to | #23369 |
On 07.04.2013 20:53, lipska the kat wrote: > I'm probably not the most experienced developer here, 15 years and > counting with Java but I've done everything from Swing based desktop > stuff (yuk) to back end business applications that are presentation > layer agnostic, to state machines that communicate with hardware devices > and apart from one particular instance I can't think of a single time > that I have ever had to use final more than once or twice in a > component. Most components don't use it at all. What are you guys > *doing* that you feel the need to modify all your variables with final > everywhere. As Arved I think "everywhere" is exaggerated. Some said they do it habitually because they got used to it and found it useful. That doesn't necessarily mean that every single item which could be "finalized" is indeed. > The whole point of a computer is to transform it's input to > some useful output, you store your input, transform it (by updating > variables usually) and emit it in a way that makes sense at that time. Making those things which are mutable to stand out vs. those which aren't helps when there are a lot variables around. One example: I had to modify a 600+ lines method (yeah, ugly). I started with refactoring because otherwise I would have had zero chance to fully understand what the code actually did. In the process I started with moving variable declarations to the most restricted scope and making things final. That helped my a great deal in understanding the logic. Then I refactored appropriate parts into separate methods. This is the kind of experience that led me to find "final" useful. Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/
[toc] | [prev] | [next] | [standalone]
| From | lipska the kat <"nospam at neversurrender dot co dot uk"> |
|---|---|
| Date | 2013-04-08 08:54 +0100 |
| Message-ID | <mtSdnSvU-9Jf6v_MnZ2dnUVZ8jidnZ2d@bt.com> |
| In reply to | #23375 |
On 08/04/13 07:28, Robert Klemme wrote: > On 07.04.2013 20:53, lipska the kat wrote: > >> I'm probably not the most experienced developer here, 15 years and >> counting with Java but I've done everything from Swing based desktop >> stuff (yuk) to back end business applications that are presentation >> layer agnostic, to state machines that communicate with hardware devices >> and apart from one particular instance I can't think of a single time >> that I have ever had to use final more than once or twice in a >> component. Most components don't use it at all. What are you guys >> *doing* that you feel the need to modify all your variables with final >> everywhere. > > As Arved I think "everywhere" is exaggerated. Some said they do it > habitually because they got used to it and found it useful. That > doesn't necessarily mean that every single item which could be > "finalized" is indeed. > >> The whole point of a computer is to transform it's input to >> some useful output, you store your input, transform it (by updating >> variables usually) and emit it in a way that makes sense at that time. > > Making those things which are mutable to stand out vs. those which > aren't helps when there are a lot variables around. > > One example: I had to modify a 600+ lines method (yeah, ugly). I > started with refactoring because otherwise I would have had zero chance > to fully understand what the code actually did. In the process I > started with moving variable declarations to the most restricted scope > and making things final. That helped my a great deal in understanding > the logic. Then I refactored appropriate parts into separate methods. > This is the kind of experience that led me to find "final" useful. I would be prepared to wager that when you had finished refactoring, your method local variables were largely *not* final. Was this the case ? lipska -- Lipska the Kat©: Troll hunter, sandbox destroyer and farscape dreamer of Aeryn Sun
[toc] | [prev] | [next] | [standalone]
| From | Robert Klemme <shortcutter@googlemail.com> |
|---|---|
| Date | 2013-04-08 19:13 +0200 |
| Message-ID | <asgc6kFpvvtU1@mid.individual.net> |
| In reply to | #23377 |
On 08.04.2013 09:54, lipska the kat wrote: > On 08/04/13 07:28, Robert Klemme wrote: >> Making those things which are mutable to stand out vs. those which >> aren't helps when there are a lot variables around. >> >> One example: I had to modify a 600+ lines method (yeah, ugly). I >> started with refactoring because otherwise I would have had zero chance >> to fully understand what the code actually did. In the process I >> started with moving variable declarations to the most restricted scope >> and making things final. That helped my a great deal in understanding >> the logic. Then I refactored appropriate parts into separate methods. >> This is the kind of experience that led me to find "final" useful. > > I would be prepared to wager that when you had finished refactoring, > your method local variables were largely *not* final. > > Was this the case ? I really don't remember what the ratio of final vs. non final variables was afterwards. But for example, foreach loop variable were indeed final. Moving variables to smallest possible scopes also nicely helped in finding a bug: there was a variable declared outside the loop and it was obviously intended to be used during one iteration only but there was a code path which allowed the last value to survive and be reused. Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/
[toc] | [prev] | [next] | [standalone]
| From | Wanja Gayk <brixomatic@yahoo.com> |
|---|---|
| Date | 2013-04-12 20:58 +0200 |
| Message-ID | <MPG.2bd277afb3a78b2798975b@202.177.16.121> |
| In reply to | #23369 |
In article <8MWdnbEIVKIMXfzMnZ2dnUVZ8tednZ2d@bt.com>, lipska the kat (lipska the kat) says... > This is what I don't get, if it's a named bin that can be refilled why > do you _decorate_ it with final. It's because it is not meant to be refilled, ever, that's what you call a constant. Kind regards, Wanja -- ..Alesi's problem was that the back of the car was jumping up and down dangerously - and I can assure you from having been teammate to Jean Alesi and knowing what kind of cars that he can pull up with, when Jean Alesi says that a car is dangerous - it is. [Jonathan Palmer] --- news://freenews.netfront.net/ - complaints: news@netfront.net ---
[toc] | [prev] | [next] | [standalone]
| From | Lew <lewbloch@gmail.com> |
|---|---|
| Date | 2013-04-12 13:17 -0700 |
| Message-ID | <eca40a21-20cf-438b-bd9b-0d2a1bda72fb@googlegroups.com> |
| In reply to | #23434 |
Wanja Gayk wrote: > lipska the kat says... >> This is what I don't get, if it's a named bin that can be refilled why >> do you _decorate_ it with final. > > It's because it is not meant to be refilled, ever, that's what you call > a constant. It is not, however, what Java calls a "constant". The point with 'final' is not that "it's a named bin that can be refilled", so the reason the conclusion didn't follow is that the premise is false. A variable is a named location that can be filled. If it's 'final', it's explicitly a named location that *cannot* be refilled. -- Lew
[toc] | [prev] | [next] | [standalone]
| From | Lew <lewbloch@gmail.com> |
|---|---|
| Date | 2013-04-07 12:40 -0700 |
| Message-ID | <7f128eff-7ea1-4cfd-9147-f57af28c931d@googlegroups.com> |
| In reply to | #23364 |
Wanja Gayk wrote: > I do find the term "final variable" a bit clumsy though, because in my > view these are constants. Unfortunately in the Java world, we're calling > these "constants" only, if they're marked "static". Technically that's That is not correct Java terminology. There is nothing in the Java definition of "constant expression" or "constant variable" that requires a static context. http://docs.oracle.com/javase/specs/jls/se7/html/jls-15.html#jls-15.28 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 initialized with a compile-time constant expression (§15.28), is called a constant variable." It does not say "final, static and ...". > rather unfortunate, as these are just as "constant" as their non static > sisters - they're just forcibly the same for a wider scope (that of the > class loader). Not so unfortunate in that the premise is incorrect:. > I guess naming these "final" instead of "const" was a result of not > wanting to confuse C-programmers, I think "const" would have been the > better name. -- Lew
[toc] | [prev] | [next] | [standalone]
| From | Wanja Gayk <brixomatic@yahoo.com> |
|---|---|
| Date | 2013-04-12 20:47 +0200 |
| Message-ID | <MPG.2bd274fbca2c7de498975a@202.177.16.121> |
| In reply to | #23371 |
In article <7f128eff-7ea1-4cfd-9147-f57af28c931d@googlegroups.com>, Lew (lewbloch@gmail.com) says... > > I do find the term "final variable" a bit clumsy though, because in my > > view these are constants. Unfortunately in the Java world, we're calling > > these "constants" only, if they're marked "static". Technically that's > > That is not correct Java terminology. There is nothing in the Java definition > of "constant expression" or "constant variable" that requires a static context. > > http://docs.oracle.com/javase/specs/jls/se7/html/jls-15.html#jls-15.28 > > 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 initialized with a compile-time constant expression (§15.28), is called a constant variable." Well, Lew, I guess you pretty much understand what I mean, it's the same thing. The term "constant variable" is a moronic oxymoron, it can be either variable or constant. It's like saying "I have a fixed movable device" - no, you haven't, you have a fixed device, by fixing it you have removed the "movable" nature entirely. > It does not say "final, static and ...". I might be used to the terminology used in the Eclipse IDE when you use the refactoring "extract constant" you'll get a static final field. Kind regards, Wanja -- ..Alesi's problem was that the back of the car was jumping up and down dangerously - and I can assure you from having been teammate to Jean Alesi and knowing what kind of cars that he can pull up with, when Jean Alesi says that a car is dangerous - it is. [Jonathan Palmer] --- news://freenews.netfront.net/ - complaints: news@netfront.net ---
[toc] | [prev] | [next] | [standalone]
| From | Lew <lewbloch@gmail.com> |
|---|---|
| Date | 2013-04-12 13:14 -0700 |
| Message-ID | <cda3450f-cf4b-4b0b-bf44-9c3d50daeb0d@googlegroups.com> |
| In reply to | #23432 |
Wanja Gayk wrote: > Lew says... >> Wanja Gayk wrote: >>> I do find the term "final variable" a bit clumsy though, because in my >>> view these are constants. Unfortunately in the Java world, we're calling >>> these "constants" only, if they're marked "static". Technically that's > >> That is not correct Java terminology. There is nothing in the Java definition >> of "constant expression" or "constant variable" that requires a static context. > >> http://docs.oracle.com/javase/specs/jls/se7/html/jls-15.html#jls-15.28 >> >> 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 initialized with a > compile-time constant expression (§15.28), is called a constant variable."> > > 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 thing would have to be static. That is not the same thing at all. > The term "constant variable" is a moronic oxymoron, it can be 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 The word "variable" in computer science does not mean "can vary". It means "a named location that can hold a value." > device" - no, you haven't, you have a fixed device, by fixing it you > 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... >> This is what I don't get, if it's a named bin that can be refilled why >> do you _decorate_ it with final. > > It's because it is not meant to be refilled, ever, that's what you call > a constant. You are arguing both sides of the fence. >> It does not say "final, static and ...". > > I might be used to the terminology used in the Eclipse IDE when you use > the refactoring "extract constant" you'll get a static final field. "Extract constant" in Eclipse as a refactoring action does indeed extract to a static constant variable. That does not mean that static variables are the only ones that can be constant. It just means that the wizard implements the common use case. -- Lew
[toc] | [prev] | [next] | [standalone]
| From | Steven Simpson <ss@domain.invalid> |
|---|---|
| Date | 2013-04-02 13:53 +0100 |
| Message-ID | <cu0r2a-jm.ln1@s.simpson148.btinternet.com> |
| In reply to | #23175 |
On 02/04/13 11:11, subhabangalore@gmail.com wrote:
> for( File name :folder.listFiles()){
> String s1=name.toString();
> System.out.println("####"+s1);
> System.out.print( name );
> ArrayList<String> myList = new ArrayList<String>();
> myList.add(s1);
> }
(Stefan has already noted that the list must be created before the
loop. What you have here is one list created per item in the folder,
and each of these lists is discarded.)
> I am getting name of files individually but I want to see them as the whole bunch like,
>
> myList=["string1","string2","string3",...."StringN"]
(Arved and Roedy have mentioned some ways to get this, though I think
you are after something different. Read on...)
> My aim is to check the names then in another for loop and if match is not found with some defined name update the list.
Your loop seems to have two purposes: 1) display all items in a certain
format; 2) build an internal List object.
Perhaps I've misinterpreted your aim, but your wish to generate a list
of names in a string with a given format leads me to think you're under
the impression that you need to display the names somehow in order to
perform the check you mention. This is not necessary (nor useful,
except for purposes of diagnosing problems). You should do the check on
the List object, not on the formatted String.
Firstly, if you must create a List, there's a quick way to create a
fixed-size one from the array provided by listFiles():
List<File> files = Arrays.asList(folder.listFiles());
Note that this is a list of File, not String; the code below does not
need a List<String>. If you really do need a List<String>, you could do
something similar with folder.list() instead of folder.listFiles().
Next, you could scan the List for a matching file. Loop over it, and
record when you find it:
boolean found = false;
for (File file : files) {
if (file.getName().equals("foo")) {
found = true;
break; // No need to go further.
}
}
However, unless you need to keep the List around for other purposes, you
could just use the array directly from listFiles():
boolean found = false;
for (File file : folder.listFiles()) {
if (file.getName().equals("foo")) {
found = true;
break; // No need to go further.
}
}
But it would be even simpler, if you're just looking for a particular
leafname (like "foo"), rather than a leafname matching a given pattern
(like anything beginning with "foo"), to create a File object
representing that name, and checking whether the file exists:
File candidate = new File(folder, "foo");
boolean found = candidate.exists();
Note that, confusingly, java.io.File represents a file name, not a file,
so 'new File(...)' does not actually create a file.
> and if match is not found with some defined name update the list.
Not sure how you intend to update the List. If it's supposed to
represent the list of files in the folder, updating the List won't
create the missing file. Perhaps you want the rest of the program to
suppose it exists; I don't know.
If you really do want to update the list, you'll have to create it as
one you can resize:
List<File> files = new ArrayList<File>(Arrays.asList(folder.listFiles()));
Read this inside out:
1. listFiles(): Get the list of filenames as an array.
2. asList(): Create a 'List view' of the array.
3. new ArrayList(): Create a modifiable list with the same contents as
the array.
--
ss at comp dot lancs dot ac dot uk
[toc] | [prev] | [next] | [standalone]
| From | Roedy Green <see_website@mindprod.com.invalid> |
|---|---|
| Date | 2013-04-02 07:10 -0700 |
| Message-ID | <pkpll8pjak75a37npac1fk2ans78s9k4b1@4ax.com> |
| In reply to | #23175 |
On Tue, 2 Apr 2013 03:11:53 -0700 (PDT), subhabangalore@gmail.com wrote, quoted or indirectly quoted someone who said : >myList=["string1","string2","string3",...."StringN"] FastCat, my replacement for StringBuilder has a toCommaList that exports a comma-separated set of strings in one long string. see http://mindprod.com/products.html#FASTCAT -- Roedy Green Canadian Mind Products http://mindprod.com Motors make noise, and that tells you about the feelings and attitudes that went into it. Something was more important than sensory pleasure -- nobody would invent a chair or dish that smelled bad or that made horrible noises -- why were motors invented noisy? How could they possibly be considered complete or successful inventions with this glaring defect? Unless, of course, the aggressive, hostile, assaultive sound actually served to express some impulse of the owner. ~ Philip Slater (born: 1927 age: 85) The Wayward Gate: Science and the Supernatural
[toc] | [prev] | [next] | [standalone]
| From | Lew <lewbloch@gmail.com> |
|---|---|
| Date | 2013-04-02 10:46 -0700 |
| Message-ID | <5bbcf921-bf9c-44a7-a604-b714ca62bb96@googlegroups.com> |
| In reply to | #23175 |
subhaba...@gmail.com wrote:
> I am taking out the files in my desktop folder, as,
"Taking out" I understood initially as "deleting", but I gather you mean "printing" or
"displaying".
> File folder = new File("C:\\Users\\subhabrata\\Desktop");
You can also use forward slashes.
> Next, I am trying to take them out one by one as using for loop and name
> of each file is converted to String,
If you indented properly your scope issues would be easier to see. The first block
doesn't have any, but the one further down does.
> for( File name :folder.listFiles()){
> String s1=name.toString();
> System.out.println("####"+s1);
> System.out.print( name );
> }
I should think you'd use 'getPath()' or 'getName()' on the 'name' instance.
> Till this there is no issue, now I am trying to insert name of all the files
> in an array, generally it can be done, as,
> ArrayList<String> myList = new ArrayList<String>();
That is not an array, that is a 'List'.
> myList.add(s1);
> But the problem I am facing is, if I put it as,
Again, proper indentation would reveal any scope issues.
> for( File name :folder.listFiles()){
> String s1=name.toString();
> System.out.println("####"+s1);
> System.out.print( name );
> ArrayList<String> myList = new ArrayList<String>();
> myList.add(s1);
> }
Now here you have a scope issue. You create a new 'List' in each iteration, add only
one item to it, then throw it away. Nowhere do you create a 'List' that survives one
loop iteration.
> I am getting name of files individually but I want to see them as the whole bunch like,
You show no code that demonstrates how you determine what "you" are "getting".
Please follow
http://sscce.org/
> myList=["string1","string2","string3",...."StringN"]
In that case, declare your 'List' in a scope that survives the loop.
> My aim is to check the names then in another for loop and if match
> is not found with some defined name update the list.
Study "scope" and "access" in Java.
> I am slightly new in Java so if anyone can kindly suggest how I should address it.
What is "slightly"?
--
Lew
[toc] | [prev] | [next] | [standalone]
| From | markspace <markspace@nospam.nospam> |
|---|---|
| Date | 2013-04-02 11:28 -0700 |
| Message-ID | <kjf7rg$2t1$1@dont-email.me> |
| In reply to | #23186 |
On 4/2/2013 10:46 AM, Lew wrote:
> subhaba...@gmail.com wrote:
>> I am taking out the files in my desktop folder, as,
> "Taking out" I understood initially as "deleting", but I gather you mean "printing" or
> "displaying".
I think he means "reading." As in he reads the file entries with these
lines of code:
>> File folder = new File("C:\\Users\\subhabrata\\Desktop");
>> ... folder.listFiles()...
>
>> Next, I am trying to take them out one by one as using for loop and name
>> of each file is converted to String,
Again, "take... out" for reading from an array.
To subhaba: "Iterate over" is often used to describe reading from an
array in a loop (for-loop or other loop).
[toc] | [prev] | [next] | [standalone]
| From | Eric Sosman <esosman@comcast-dot-net.invalid> |
|---|---|
| Date | 2013-04-02 16:00 -0400 |
| Message-ID | <kjfd8j$er1$1@dont-email.me> |
| In reply to | #23187 |
On 4/2/2013 2:28 PM, markspace wrote:
> On 4/2/2013 10:46 AM, Lew wrote:
>
>> subhaba...@gmail.com wrote:
>>> I am taking out the files in my desktop folder, as,
>
>> "Taking out" I understood initially as "deleting", but I gather you
>> mean "printing" or
>> "displaying".
>
> I think he means "reading." As in he reads the file entries with these
> lines of code:
>
>>> File folder = new File("C:\\Users\\subhabrata\\Desktop");
> >> ... folder.listFiles()...
>
>>
>>> Next, I am trying to take them out one by one as using for loop and name
>>> of each file is converted to String,
>
> Again, "take... out" for reading from an array.
>
> To subhaba: "Iterate over" is often used to describe reading from an
> array in a loop (for-loop or other loop).
Let's not give the impression that "iterate" or even "iterate
over" implies read-only activities. If it did, why would the
Iterator interface specify a remove() method? :)
Typical usage is "The code iterates over the array (or list,
or sequence, or collection), doing thus-and-such." It's the
thus-and-such part that indicates whether reading or writing (or
both, or something more complicated) is involved; iteration is
just the procedure for making the visits, not their nature.
"Iterate over the array, looking for the minimum value."
"Iterate over the array, converting all the values from
degrees to radians."
If the iteration is simple or obvious (or irrelevant) it
probably doesn't get mentioned at all: The above would likely
be "find the minimum" and "convert degrees to radians." The
main reason to mention the iteration itself would be if there's
something special or unusual about it:
"The list is sorted from smallest to largest. Iterate
backwards to output the items in descending order."
"Basic cocktail-shaker sort: Iterate over the list,
exchanging adjacent pairs of elements that are out of order.
Then make another pass, this time iterating in the opposite
direction. Repeat, alternating directions, until a pass
makes no exchanges."
--
Eric Sosman
esosman@comcast-dot-net.invalid
[toc] | [prev] | [next] | [standalone]
| From | subhabangalore@gmail.com |
|---|---|
| Date | 2013-04-03 01:47 -0700 |
| Message-ID | <6757cccc-794e-4dd1-8d73-9cb617b75572@googlegroups.com> |
| In reply to | #23175 |
On Tuesday, April 2, 2013 3:41:53 PM UTC+5:30, subhaba...@gmail.com wrote:
> Dear Group,
>
>
>
> I am taking out the files in my desktop folder, as,
>
>
>
> File folder = new File("C:\\Users\\subhabrata\\Desktop");
>
>
>
> Next, I am trying to take them out one by one as using for loop and name
>
> of each file is converted to String,
>
>
>
> for( File name :folder.listFiles()){
>
> String s1=name.toString();
>
> System.out.println("####"+s1);
>
> System.out.print( name );
>
> }
>
>
>
> Till this there is no issue, now I am trying to insert name of all the files in an array, generally it can be done, as,
>
>
>
> ArrayList<String> myList = new ArrayList<String>();
>
> myList.add(s1);
>
>
>
> But the problem I am facing is, if I put it as,
>
>
>
> for( File name :folder.listFiles()){
>
> String s1=name.toString();
>
> System.out.println("####"+s1);
>
> System.out.print( name );
>
> ArrayList<String> myList = new ArrayList<String>();
>
> myList.add(s1);
>
> }
>
>
>
> I am getting name of files individually but I want to see them as the whole bunch like,
>
>
>
> myList=["string1","string2","string3",...."StringN"]
>
>
>
> My aim is to check the names then in another for loop and if match is not found with some defined name update the list.
>
>
>
> I am slightly new in Java so if anyone can kindly suggest how I should address it.
>
>
>
> Regards,
>
> Subhabrata.
Thanks Room for suggestion and discussion. It worked. Regards,Subhabrata.
[toc] | [prev] | [next] | [standalone]
Page 8 of 9 — ← Prev page 1 2 3 4 5 6 7 [8] 9 Next page →
Back to top | Article view | comp.lang.java.programmer
csiph-web