Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #16925
| Path | csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.glorb.com!news-out.readnews.com!transit3.readnews.com!news-out.news.tds.net!newsreading01.news.tds.net!53ab2750!not-for-mail |
|---|---|
| From | "Lew" <lew@1:261/38.remove-s5i-this> |
| Subject | Re: initialize an array of booleans |
| Message-ID | <50197005.55891.calajapr@time.synchro.net> (permalink) |
| X-Comment-To | bob smith |
| Newsgroups | comp.lang.java.programmer |
| In-Reply-To | <50197002.55874.calajapr@time.synchro.net> |
| References | <50197002.55874.calajapr@time.synchro.net> |
| X-FTN-AREA | COMP.LANG.JAVA.PROGRAMMER |
| X-FTN-MSGID | 1:261/38 65230488 |
| X-FTN-REPLY | 1:261/38 1a997b26 |
| Content-Type | text/plain; charset=IBM437 |
| Content-Transfer-Encoding | 8bit |
| X-Gateway | time.synchro.net [Synchronet 3.16a-Win32 NewsLink 1.98] |
| Lines | 31 |
| Date | Wed, 01 Aug 2012 18:09:34 GMT |
| NNTP-Posting-Host | 69.21.70.65 |
| X-Complaints-To | news@tds.net |
| X-Trace | newsreading01.news.tds.net 1343844574 69.21.70.65 (Wed, 01 Aug 2012 13:09:34 CDT) |
| NNTP-Posting-Date | Wed, 01 Aug 2012 13:09:34 CDT |
| Organization | tds.net |
| Xref | csiph.com comp.lang.java.programmer:16925 |
Show key headers only | View raw
To: bob smith From: Lew <lewbloch@gmail.com> On Tuesday, July 31, 2012 12:58:58 PM UTC-7, bob smith wrote: > Is there any easy way to initialize an array of booleans like this? > > > > boolean b[] = new boolean(false)[100]; boolean b[] = new boolean [100]; <http://docs.oracle.com/javase/specs/jls/se7/html/jls-15.html#jls-15.10.1> If you want to initialize array elements to a value that is not the default you have to loop. Or use the 'java.util.Arrays' class. <http://docs.oracle.com/javase/7/docs/api/java/util/Arrays.html#fill(boolean[], boolean)> Every Java programmer should know the collections framework and key utility classes like 'Arrays'. -- Lew --- BBBS/Li6 v4.10 Dada-1 * Origin: Prism bbs (1:261/38) --- Synchronet 3.16a-Win32 NewsLink 1.98 Time Warp of the Future BBS - telnet://time.synchro.net:24
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
initialize an array of booleans "bob smith" <bob.smith@1:261/38.remove-s5i-this> - 2012-08-01 18:09 +0000 Re: initialize an array of booleans "Eric Sosman" <eric.sosman@1:261/38.remove-s5i-this> - 2012-08-01 18:09 +0000 Re: initialize an array of booleans "Lew" <lew@1:261/38.remove-s5i-this> - 2012-08-01 18:09 +0000 Re: initialize an array of booleans "Roedy Green" <roedy.green@1:261/38.remove-s5i-this> - 2012-08-01 18:09 +0000
csiph-web