• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Array bracket

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
<P>
From the book "Complete Java 3 Certification guide 2nd Edition" it says that its wrong to put the array bracket between the type and variable.
<p>
Example
public static void main <b>(String [] args)</b>
<p>
The book said that the previous statement is wrong but it runs both on 1.2 and 1.3.
Thanks!

 
Author
Posts: 201
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It is more a style question than anything else. It falls back to C/C++ and the position of the pointer variables.
 
EJ Dinglasan
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
But technically its supposed to work so it shouldnt be worng.
Thanks
 
mister krabs
Posts: 13974
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This should have been a clue:
"Complete Java 3 Certification guide 2nd Edition"
There is no Java 3 yet so perhaps the book is just telling you what will happen in the future.
 
EJ Dinglasan
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hehe!
Sorry for the typo.
But seriously if it came out in the exam,
should it be valid or not?
Thanks!
 
Thomas Paul
mister krabs
Posts: 13974
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It may be morally wrong and you may go to Java purgatory but it compiles cleanly and it works which tells me that it is valid.
reply
    Bookmark Topic Watch Topic
  • New Topic