Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

declaring arrays

 
Jim Rock
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can you have a space between your brackets [] and array name
for example are the following two declarations the same
int[] x new int[25];
int [] x new int [25];
 
Rick Rodriguez
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, the Java compiler does not care about the spaces. Any of the declarations/initializations in your post will compile without any errors.
I tried it myself.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic