• Post Reply Bookmark Topic Watch Topic
  • New Topic

declaring arrays  RSS feed

 
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
Boost this thread!