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


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

Re: Arrays in java

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
From Arun GOPI <arun041@gmail.com>
Newsgroups comp.lang.java.programmer
Subject Re: Arrays in java
Date Mon, 16 Jul 2012 02:53:59 -0700 (PDT)
Organization http://groups.google.com
Lines 12
Message-ID <848eec20-ab75-4a89-b605-cc5fc81b09d5@googlegroups.com> (permalink)
References <7eb3b37e-612a-4f51-98e5-f39cfd565739@googlegroups.com>
NNTP-Posting-Host 210.212.236.21
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1
X-Trace posting.google.com 1342432440 29348 127.0.0.1 (16 Jul 2012 09:54:00 GMT)
X-Complaints-To groups-abuse@google.com
NNTP-Posting-Date Mon, 16 Jul 2012 09:54:00 +0000 (UTC)
In-Reply-To <7eb3b37e-612a-4f51-98e5-f39cfd565739@googlegroups.com>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=210.212.236.21; posting-account=dww7oQoAAAAMWgKVIaqd5pk2iBUToh2n
User-Agent G2/1.0
Xref csiph.com comp.lang.java.programmer:16039

Show key headers only | View raw


On Monday, 9 July 2012 20:24:39 UTC+5:30, mmc.java  wrote:
> I am just starting to learn java and wanted to know when creating an array if there is any reason why you choose one of the following over the others or if it is just a styling choice by the developer
> 
> int productIDs[] = {10,20,30};	
> int []productIDs = {10,20,30};	
> int[] productIDs = {10,20,30};	
> 
> I did notice the the following will cause a compilation error 
> []int productIDs = {10,20,30}; //causes an error

By java convention the standard is int[] productIDs = {10,20,30};
the brackets must indicate the data type.The other way is also allowed but discourager.refer : http://docs.oracle.com/javase/tutorial/java/nutsandbolts/arrays.html

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


Thread

Arrays in java "mmc.java" <michael.p.mulligan@gmail.com> - 2012-07-09 07:54 -0700
  Re: Arrays in java Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-07-09 11:30 -0400
    Re: Arrays in java Patricia Shanahan <pats@acm.org> - 2012-07-09 15:03 -0700
      Re: Arrays in java Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-07-09 15:16 -0700
        Re: Arrays in java Lew <lewbloch@gmail.com> - 2012-07-09 16:14 -0700
          Re: Arrays in java Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-07-09 21:43 -0700
            Re: Arrays in java Lew <noone@lewscanon.com> - 2012-07-09 23:47 -0700
          Re: Arrays in java Roedy Green <see_website@mindprod.com.invalid> - 2012-07-11 15:32 -0700
            Re: Arrays in java Lew <lewbloch@gmail.com> - 2012-07-11 16:21 -0700
              Re: Arrays in java Gene Wirchenko <genew@ocis.net> - 2012-07-11 17:08 -0700
                Re: Arrays in java Lew <lewbloch@gmail.com> - 2012-07-11 17:20 -0700
                Re: Arrays in java Gene Wirchenko <genew@ocis.net> - 2012-07-11 22:09 -0700
                Re: Arrays in java Lew <lewbloch@gmail.com> - 2012-07-12 11:31 -0700
                Re: Arrays in java Gene Wirchenko <genew@ocis.net> - 2012-07-13 09:07 -0700
                Re: Arrays in java Lew <lewbloch@gmail.com> - 2012-07-13 13:00 -0700
                Re: Arrays in java Patricia Shanahan <pats@acm.org> - 2012-07-15 00:54 -0500
                Re: Arrays in java Jeff Higgins <jeff@invalid.invalid> - 2012-07-16 15:59 -0400
                Re: Arrays in java Patricia Shanahan <pats@acm.org> - 2012-07-16 23:44 -0700
                Re: Arrays in java glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2012-07-17 08:01 +0000
                Re: Arrays in java Patricia Shanahan <pats@acm.org> - 2012-07-17 03:04 -0700
                Re: Arrays in java Lew <lewbloch@gmail.com> - 2012-07-17 13:02 -0700
                Re: Arrays in java Patricia Shanahan <pats@acm.org> - 2012-07-17 22:03 -0700
                Re: Arrays in java Lew <noone@lewscanon.com> - 2012-07-17 22:10 -0700
                Re: Arrays in java glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2012-07-18 05:12 +0000
                Re: Arrays in java Patricia Shanahan <pats@acm.org> - 2012-07-17 22:39 -0700
                Re: Arrays in java Martin Gregorie <martin@address-in-sig.invalid> - 2012-07-18 21:24 +0000
                Re: teaching Java and formal grammars Patricia Shanahan <pats@acm.org> - 2012-07-19 06:48 -0700
                Re: teaching Java and formal grammars Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-07-19 10:27 -0400
                Re: teaching Java and formal grammars Gene Wirchenko <genew@ocis.net> - 2012-07-19 10:55 -0700
                Re: Arrays in java Patricia Shanahan <pats@acm.org> - 2012-07-13 08:28 -0500
            Re: Arrays in java Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-07-11 18:33 -0700
  Re: Arrays in java markspace <-@.> - 2012-07-09 09:17 -0700
    Re: Arrays in java Lew <lewbloch@gmail.com> - 2012-07-09 12:56 -0700
  Re: Arrays in java Joshua Cranmer <Pidgeot18@verizon.invalid> - 2012-07-09 12:45 -0400
  Re: Arrays in java Roedy Green <see_website@mindprod.com.invalid> - 2012-07-09 11:03 -0700
  Re: Arrays in java Arun GOPI <arun041@gmail.com> - 2012-07-16 02:53 -0700

csiph-web