This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes What is the difference between these statements Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "What is the difference between these statements" Watch "What is the difference between these statements" New topic
Author

What is the difference between these statements

Douglas Braxton
Ranch Hand

Joined: Jan 28, 2004
Posts: 36
private int a[ ];
and
private int[ ] a;
???
Rikard Qvarforth
Ranch Hand

Joined: Jul 10, 2001
Posts: 107
Well nothing really.. but i think the xxx[] a is more common for c++ programmers or was it the otherway ? humm dont remember but say an array of int "int[]" or an array of int but "int []x" i think its more clear if you put the bracets with the type.
well hope this helps in my dissoriented explaining and bad english
//Rille
Douglas Braxton
Ranch Hand

Joined: Jan 28, 2004
Posts: 36
so is "a" the name of the array?
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 9948
    
    6

In this case, "a" would be the name of the array.
I think they adopted both ways since in C/C++, you'd declare an array more like the first way, but most people think the second is easier to read.


Never ascribe to malice that which can be adequately explained by stupidity.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: What is the difference between these statements
 
Similar Threads
Problem with default '' , 0 and 0.0 being inserted into database while using JSTL.
Declaring Multiple Private Variables
one Construtor's problem?
Selection Sort?
Magic numbers in code