Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #15895 > unrolled thread
| Started by | "mmc.java" <michael.p.mulligan@gmail.com> |
|---|---|
| First post | 2012-07-09 07:54 -0700 |
| Last post | 2012-07-16 02:53 -0700 |
| Articles | 16 on this page of 36 — 14 participants |
Back to article view | Back to comp.lang.java.programmer
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
Page 2 of 2 — ← Prev page 1 [2]
| From | Lew <lewbloch@gmail.com> |
|---|---|
| Date | 2012-07-17 13:02 -0700 |
| Message-ID | <bba9c622-4f2a-476a-a433-2ad16f595f4f@googlegroups.com> |
| In reply to | #16059 |
Patricia Shanahan wrote:
> Lew wrote:
> ...
> > - I claimed that the JLS is an essential tool to learning Java,
> > along with recommending other useful sources. No one
> > has even said that it isn't, much less established that it isn't.
>
> This seems to assume that there is one thing that can be called
> "learning Java".
>
> I don't think of knowing a programming language as a binary property,
> but in terms of a continuous range of levels of knowledge.
>
> One end of the range is "never even heard of it". At the other end of
> the range is the sort of knowledge that James Gosling has for Java, or
> Bjarne Stroustrup for C++.
>
> The highest level of language knowledge I've ever achieved for any
> language is that needed to produce a working implementation on a real
> computer, which I've only done for K&R C and Fortran 77. That requires
> familiarity with the language's defining documents as well as full,
> detailed understanding of how it really works. I don't have quite that
> level of knowledge for Java.
>
> What does "learning Java" mean in the context of a beginner? I suggest
> that a reasonable default is "know the language well enough to write
> professional quality code in it".
>
> Putting it in the context of this thread, I would say it includes
> knowing that "int[] productIDs = {10,20,30};" is normal code to declare
> an array reference and initialize it. I am not sure it includes knowing
> which weird arrangements of "[]" placement are permitted for
> multi-dimensional arrays.
>
> I contend that reading the JLS is not necessary for that level of
> knowledge of Java. Reading good secondary sources is likely to be more
> effective.
>
> > - I claimed that actively discouraging newbies (or anyone
> > else) from studying the JLS is a disservice to their learning
> > and professional progress. No one has addressed this point.
> >
>
> I strongly disagree. I was already a very experienced programmer in
> several languages, and had studied the defining documents for some of
> them, when Java was developed, but I can imagine facing
> learning Java as a beginning programmer. If, as a beginner, I had
> thought that understanding something like JLS section 17.4,
> http://docs.oracle.com/javase/specs/jls/se7/html/jls-17.html#jls-17.4,
> were necessary to learn Java, I would have abandoned the attempt in
> favor of some language that could be learned using only simpler, more
> readable, materials.
I disagree partially with your points, but they are cogent and well supported.
I don't believe a beginner should rely on the JLS to learn the language, as I
have stated many times. I do agree that the JLS can be rather daunting, at first,
and like any other specification is in some places just a bit thick, but as specs
go it really is comparatively clear, and parts are as baldly and simply stated as
anyone could wish.
The problem is that without an awareness of the JLS, one can be misled by
inaccurate or incomplete information from secondary and tertiary sources.
Many of the discussions are prime examples, and the ones where one reference
specific JLS passages, they tend to unequivocally settle issues of Java fact.
To actively discourage newbies from studying the JLS is to limit them. This
is different from simply not recommending the JLS as a beginner's tool.
Even new Java programmers at a minimum need to know that the JLS
exists, and that it is the authority, and that should they really, really wish
final resolution to certain questions, it is found there. They should have
it as a goal to be able to use it.
I started using the JLS very early in my Java career, and it has never
given me cause to regret that choice.
I also assert that it isn't anywhere near as impossible as all the fear-
mongers claim, except in some few parts. Regardless, I respect your
conclusions, even the ones with which I disagree.
Bottom line, I go with something like glen herrmannsfeldt's idea, that
for each Java programmer there comes a time when it makes sense
to use the JLS. The earlier one knows that the JLS option exists, the
more power one has to exercise choice over gaining that next,
minimum level of Java programming capability.
--
Lew
[toc] | [prev] | [next] | [standalone]
| From | Patricia Shanahan <pats@acm.org> |
|---|---|
| Date | 2012-07-17 22:03 -0700 |
| Message-ID | <L-GdncTH_MUr3pvNnZ2dnUVZ_hidnZ2d@earthlink.com> |
| In reply to | #16073 |
Lew wrote: ... > I started using the JLS very early in my Java career, and it has never > given me cause to regret that choice. I feel the same way, but that is irrelevant because of my prior experience. Was the start of your Java career also the very first time you had ever attempted to write a computer program? Some colleges are using Java as the first language for their freshman computer science students, and teaching it as one of the first courses. That means there are teenagers trying to learn Java who have no idea what a formal grammar is, or how it works. > I also assert that it isn't anywhere near as impossible as all the fear- > mongers claim, except in some few parts. Regardless, I respect your > conclusions, even the ones with which I disagree. > > Bottom line, I go with something like glen herrmannsfeldt's idea, that > for each Java programmer there comes a time when it makes sense > to use the JLS. The earlier one knows that the JLS option exists, the > more power one has to exercise choice over gaining that next, > minimum level of Java programming capability. > I think the word "minimum" is where we disagree. I think one can become a very competent Java programmer without having read the JLS. Patricia
[toc] | [prev] | [next] | [standalone]
| From | Lew <noone@lewscanon.com> |
|---|---|
| Date | 2012-07-17 22:10 -0700 |
| Message-ID | <ju5gg3$hce$1@news.albasani.net> |
| In reply to | #16076 |
Patricia Shanahan wrote: > Lew wrote: > ... >> I started using the JLS very early in my Java career, and it has never given >> me cause to regret that choice. > > I feel the same way, but that is irrelevant because of my prior > experience. Was the start of your Java career also the very first time > you had ever attempted to write a computer program? > > Some colleges are using Java as the first language for their freshman > computer science students, and teaching it as one of the first courses. > That means there are teenagers trying to learn Java who have no idea > what a formal grammar is, or how it works. > >> I also assert that it isn't anywhere near as impossible as all the fear- >> mongers claim, except in some few parts. Regardless, I respect your >> conclusions, even the ones with which I disagree. >> >> Bottom line, I go with something like glen herrmannsfeldt's idea, that for >> each Java programmer there comes a time when it makes sense to use the JLS. >> The earlier one knows that the JLS option exists, the more power one has to >> exercise choice over gaining that next, minimum level of Java programming >> capability. >> > > I think the word "minimum" is where we disagree. I think one can become > a very competent Java programmer without having read the JLS. Fair enough. -- Lew Honi soit qui mal y pense. http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg
[toc] | [prev] | [next] | [standalone]
| From | glen herrmannsfeldt <gah@ugcs.caltech.edu> |
|---|---|
| Date | 2012-07-18 05:12 +0000 |
| Message-ID | <ju5gkp$opb$1@speranza.aioe.org> |
| In reply to | #16076 |
Patricia Shanahan <pats@acm.org> wrote: > Lew wrote: > ... >> I started using the JLS very early in my Java career, and it has never >> given me cause to regret that choice. > I feel the same way, but that is irrelevant because of my prior > experience. Was the start of your Java career also the very first time > you had ever attempted to write a computer program? I learned my first language, Fortran, from the IBM S/360 Fortran IV reference manual. Then again, I am probably not a typical case. > Some colleges are using Java as the first language for their freshman > computer science students, and teaching it as one of the first courses. > That means there are teenagers trying to learn Java who have no idea > what a formal grammar is, or how it works. -- glen
[toc] | [prev] | [next] | [standalone]
| From | Patricia Shanahan <pats@acm.org> |
|---|---|
| Date | 2012-07-17 22:39 -0700 |
| Message-ID | <h7Kdnboobo2G0ZvNnZ2dnUVZ_i2dnZ2d@earthlink.com> |
| In reply to | #16078 |
glen herrmannsfeldt wrote: > Patricia Shanahan <pats@acm.org> wrote: >> Lew wrote: >> ... >>> I started using the JLS very early in my Java career, and it has never >>> given me cause to regret that choice. > >> I feel the same way, but that is irrelevant because of my prior >> experience. Was the start of your Java career also the very first time >> you had ever attempted to write a computer program? > > I learned my first language, Fortran, from the IBM S/360 Fortran IV > reference manual. Then again, I am probably not a typical case. Also, I think that manual was considerably simpler and more accessible than the JLS. Patricia
[toc] | [prev] | [next] | [standalone]
| From | Martin Gregorie <martin@address-in-sig.invalid> |
|---|---|
| Date | 2012-07-18 21:24 +0000 |
| Message-ID | <ju79j4$cmh$1@localhost.localdomain> |
| In reply to | #16076 |
On Tue, 17 Jul 2012 22:03:54 -0700, Patricia Shanahan wrote: > Lew wrote: > ... >> I started using the JLS very early in my Java career, and it has never >> given me cause to regret that choice. > > I feel the same way, but that is irrelevant because of my prior > experience. Was the start of your Java career also the very first time > you had ever attempted to write a computer program? > > Some colleges are using Java as the first language for their freshman > computer science students, and teaching it as one of the first courses. > That means there are teenagers trying to learn Java who have no idea > what a formal grammar is, or how it works. > My first language was Algol 60[*], so of course I rapidly became familiar with BNF notation, since all Algol 60 manuals included the BNF-defined syntax as an appendix. Consequently, I more or less expect any language's syntax to be described fairly formally, preferably by using BNF or at least the tram-track diagrams that Pascal introduced. [*] I learned Algol 60 at University as an add-on to my MSc because I needed to use our Elliott 503 to analyse output from the Moessbauer spectrometer I was using as part of my thesis. >> I also assert that it isn't anywhere near as impossible as all the >> fear- >> mongers claim, except in some few parts. Regardless, I respect your >> conclusions, even the ones with which I disagree. >> >> Bottom line, I go with something like glen herrmannsfeldt's idea, that >> for each Java programmer there comes a time when it makes sense to use >> the JLS. The earlier one knows that the JLS option exists, the more >> power one has to exercise choice over gaining that next, >> minimum level of Java programming capability. >> >> > I think the word "minimum" is where we disagree. I think one can become > a very competent Java programmer without having read the JLS. > > Patricia -- martin@ | Martin Gregorie gregorie. | Essex, UK org |
[toc] | [prev] | [next] | [standalone]
| From | Patricia Shanahan <pats@acm.org> |
|---|---|
| Date | 2012-07-19 06:48 -0700 |
| Subject | Re: teaching Java and formal grammars |
| Message-ID | <3NGdnSdxL7SpjZXNnZ2dnUVZ_t2dnZ2d@earthlink.com> |
| In reply to | #16076 |
Stefan Ram wrote: > Patricia Shanahan <pats@acm.org> writes: >> That means there are teenagers trying to learn Java who have no idea >> what a formal grammar is, or how it works. > > In my first Java programming classes for a general audience at > an evening school for adults, I started out to teach EBNF first. > But now I have given up on this, because it confused the people. > Sometimes, EBNF productions were confused with Java source code > and were written into the program! But even if this would not > happen, it costs time to teach EBNF, which is then lacking for > Java in those relatively short-time classes. If I would have to > give classes with more than 100 hours, I might start to teach > EBNF first. But my classes usually have about 18 hours for the > beginner class (plus about 12 - 18 hours for an optional > continuation class, the »advanced course«). > I am not sure hours of instruction are the important thing for programming language learning. How much time are the students able and willing to spend outside class? I wonder whether the Java and EBNF could be taught in parallel without causing confusion. For example, teach enough Java to write a very simple application, then show a simplified extract of the Java grammar that is sufficient to derive the applications the students now know how to write. Patricia
[toc] | [prev] | [next] | [standalone]
| From | Eric Sosman <esosman@ieee-dot-org.invalid> |
|---|---|
| Date | 2012-07-19 10:27 -0400 |
| Subject | Re: teaching Java and formal grammars |
| Message-ID | <ju95h9$nc9$1@dont-email.me> |
| In reply to | #16105 |
On 7/19/2012 10:07 AM, Stefan Ram wrote:
> Patricia Shanahan <pats@acm.org> writes:
>> I am not sure hours of instruction are the important thing for
>> programming language learning. How much time are the students able and
>> willing to spend outside class?
>
> No time. The classes are visited by employees, pupils, and
> students, who need or want to use the rest of their time
> for their job/life, school, or university. When I tried to
> give homework, it was never done.
That's too bad. Programming is not just an abstract body of
knowledge, a list of facts and theorems. Programming is also a
craft requiring skills, skills that are acquired (and maintained)
by practice. No practice -> no programmer.
--
Eric Sosman
esosman@ieee-dot-org.invalid
[toc] | [prev] | [next] | [standalone]
| From | Gene Wirchenko <genew@ocis.net> |
|---|---|
| Date | 2012-07-19 10:55 -0700 |
| Subject | Re: teaching Java and formal grammars |
| Message-ID | <1big08pnfc993bb4a6n4pb11ijhntc0lhi@4ax.com> |
| In reply to | #16105 |
On 19 Jul 2012 14:07:54 GMT, ram@zedat.fu-berlin.de (Stefan Ram)
wrote:
>Patricia Shanahan <pats@acm.org> writes:
>>I am not sure hours of instruction are the important thing for
>>programming language learning. How much time are the students able and
>>willing to spend outside class?
>
> No time. The classes are visited by employees, pupils, and
> students, who need or want to use the rest of their time
> for their job/life, school, or university. When I tried to
> give homework, it was never done.
They have time. They just choose to spend it otherwise. Not
spending enough time with programming means one does not become
competent. While acknowledging that it is their choice, I would make
that clear in class.
>>I wonder whether the Java and EBNF could be taught in parallel without
>>causing confusion. For example, teach enough Java to write a very simple
>>application, then show a simplified extract of the Java grammar that is
>>sufficient to derive the applications the students now know how to write.
>
> Yes, I tried this. From the beginning I only showed a
> simplified grammar restricted to the parts that are actually
> used in class, but even that was too hard. But maybe I'll
> try »railroad diagrams« as used in Pascal. It should make
> clear that this is not intended to become a part of Java
> source code.
>
> For example, the curly braces: Some of my students don't
> even know the German name of the character »{« when they
> come into my class. It seems they never encountered this
> symbol before in their life. Suddenly they see it in both
> Java and EBNF with two totally different meanings. That
> seems to be too much.
You are trying to teach the functionally illiterate how to
program?
Sincerely,
Gene Wirchenko
[toc] | [prev] | [next] | [standalone]
| From | Patricia Shanahan <pats@acm.org> |
|---|---|
| Date | 2012-07-13 08:28 -0500 |
| Message-ID | <452023009363876561.054866pats-acm.org@news.west.earthlink.net> |
| In reply to | #15975 |
Gene Wirchenko <genew@ocis.net> wrote: ... > I have not read the JLS, but as I noted in my post, I did read > much of the JavaScript standard. There were parts of it that were > very lucid indeed. I expect that the JLS has lucid portions, too. > However, there were parts of the JavaScript standard that were very > obtuse. Were I interested in implementing a JavaScript processor, > they would probably be just about what I needed, but for app > programmer level, no, very unclear. I expect that the same is true > for the JLS. > > Langauge standards and language documentation for programmers are > two different things with some overlap. I would not wish the standard > for any language on a newbie to the language. After he has the > basics, yes, it would be appropriate then. I have read the JLS, several times, and I agree with Gene. If I had tried to read it all when I was new to programming I would have been hopelessly lost in some sections. If I had believed reading it was necessary I might have given up on Java. Even now, I use secondary materials for practical programming advice. I study the JLS because I am interested in programming languages and standards. I am a former compiler writer. Patricia
[toc] | [prev] | [next] | [standalone]
| From | Daniel Pitts <newsgroup.nospam@virtualinfinity.net> |
|---|---|
| Date | 2012-07-11 18:33 -0700 |
| Message-ID | <3QpLr.3951$Kb4.1808@newsfe20.iad> |
| In reply to | #15953 |
On 7/11/12 3:32 PM, Roedy Green wrote: > On Mon, 9 Jul 2012 16:14:36 -0700 (PDT), Lew <lewbloch@gmail.com> > wrote, quoted or indirectly quoted someone who said : > >> Know. Don't guess. Read the JLS. > > And I have explained to you many times that not everyone can make hide > nor tail of that lawyerly document. YOU can, but perhaps only one in > 100 programmers can accurately decode it. It is plain rude to demand > newbies use it. Encourage them yes, but don't pretend it as a skill > everyone is suppose to master to justify their existence. You are > using it like some frat hazing. I resent being called a newbie :-) I'll admit that I was being lazy (due to pain, low blood sugar, and sleep deprivation), and should have looked up, or at least tested, the assertion that I wrote "I guess" to instead.
[toc] | [prev] | [next] | [standalone]
| From | markspace <-@.> |
|---|---|
| Date | 2012-07-09 09:17 -0700 |
| Message-ID | <jtf063$odo$1@dont-email.me> |
| In reply to | #15895 |
On 7/9/2012 7:54 AM, 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
It's "style choice" but there a convention too, most of the code I've
seen uses the style below. For readability, I'd recommend it.
(Readability = it's what everyone is used to seeing.)
> int[] productIDs = {10,20,30};
[toc] | [prev] | [next] | [standalone]
| From | Lew <lewbloch@gmail.com> |
|---|---|
| Date | 2012-07-09 12:56 -0700 |
| Message-ID | <17ea472c-8e7e-4255-94fe-de696838e315@googlegroups.com> |
| In reply to | #15897 |
markspace wrote:
> mmc.java wrote:
>> I am just starting to learn java [sic] 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
The brackets with the type is the more sensible style.
Putting brackets on the variable splits the type information between the
beginning and the end of the declaration. It's more sensible to keep
all the type part of the declaration together.
> It's "style choice" but there a convention too, most of the code I've
> seen uses the style below. For readability, I'd recommend it.
> (Readability = it's what everyone is used to seeing.)
>
> > int[] productIDs = {10,20,30};
It's also logic.
The array dimensions are part of the type. So the type of 'productIDs'
in your example is 'int[]'. Splitting that into 'int productIDs[]' is both
less logical and less readable.
Regardless of your style choice (i.e., the right style or the wrong one)
the code conventions require that you not mix types on one line of
declaration. This is moot of you follow the other convention to
declare only one variable per line.
<http://www.oracle.com/technetwork/java/javase/documentation/codeconventions-141270.html#2992>
Note also that the return type of a method must use the 'int[]' form,
so varying that for variables makes even less sense.
--
Lew
[toc] | [prev] | [next] | [standalone]
| From | Joshua Cranmer <Pidgeot18@verizon.invalid> |
|---|---|
| Date | 2012-07-09 12:45 -0400 |
| Message-ID | <jtf1rk$4lq$1@dont-email.me> |
| In reply to | #15895 |
On 7/9/2012 10:54 AM, 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};
This one, I suspect, is a holdover from C/C++, where the array specifier
has to come after the variable name. I'd recommend not using it, since
it makes it less clear that 'int[]' is the type.
> int []productIDs = {10,20,30};
> int[] productIDs = {10,20,30};
These two are effectively equivalent, differing only in whether you
think "int []" or "int[]" is a more natural way to specify the type. I
tend towards the latter, since "[]" is bound to the int type and not to
the name of productIDs.
--
Beware of bugs in the above code; I have only proved it correct, not
tried it. -- Donald E. Knuth
[toc] | [prev] | [next] | [standalone]
| From | Roedy Green <see_website@mindprod.com.invalid> |
|---|---|
| Date | 2012-07-09 11:03 -0700 |
| Message-ID | <e57mv79rlk5hkpq6g4mhbj46kjh6bs65re@4ax.com> |
| In reply to | #15895 |
On Mon, 9 Jul 2012 07:54:39 -0700 (PDT), "mmc.java"
<michael.p.mulligan@gmail.com> wrote, quoted or indirectly quoted
someone who said :
>int[] productIDs = {10,20,30};
the [] are part of the type so I like to keep them together. The
other style was to make Java look more like C.
see http://mindprod.com/jgloss/array.html
for things a newbie needs to know about arrays.
--
Roedy Green Canadian Mind Products
http://mindprod.com
Why do so many operating systems refuse to define a standard
temporary file marking mechanism? It could be a reserved lead character
such as the ~ or a reserved extension such as .tmp.
It could be a file attribute bit. Because they refuse, there is no
fool-proof way to scan a disk for orphaned temporary files and delete them.
Further, you can't tell where the orhaned files ame from.
This means the hard disks gradually fill up with garbage.
[toc] | [prev] | [next] | [standalone]
| From | Arun GOPI <arun041@gmail.com> |
|---|---|
| Date | 2012-07-16 02:53 -0700 |
| Message-ID | <848eec20-ab75-4a89-b605-cc5fc81b09d5@googlegroups.com> |
| In reply to | #15895 |
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
[toc] | [prev] | [standalone]
Page 2 of 2 — ← Prev page 1 [2]
Back to top | Article view | comp.lang.java.programmer
csiph-web