Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Array bug?

 
Alejandro Casarrubias
Greenhorn
Posts: 12
Chrome MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this a bug? what do you think.
Im thinking and i cant find a purpose for this


int[] arreglo3 = {,};

Thanks in advice.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's not a bug. Check 10.6 Array Initializers :
A trailing comma may appear after the last expression in an array initializer and is ignored.

So your code is equivalent to :

which initializes an empty array.
 
Alejandro Casarrubias
Greenhorn
Posts: 12
Chrome MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your help.
 
Alejandro Casarrubias
Greenhorn
Posts: 12
Chrome MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ups i didnt read well. for me
 
Campbell Ritchie
Sheriff
Pie
Posts: 48981
60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A similar question appears here.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic