aspose file tools*
The moose likes Java in General and the fly likes Array bug? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Array bug?" Watch "Array bug?" New topic
Author

Array bug?

Alejandro Casarrubias
Greenhorn

Joined: Sep 21, 2006
Posts: 12

Is this a bug? what do you think.
Im thinking and i cant find a purpose for this


int[] arreglo3 = {,};

Thanks in advice.


SCJP 5.0
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

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.


[My Blog]
All roads lead to JavaRanch
Alejandro Casarrubias
Greenhorn

Joined: Sep 21, 2006
Posts: 12

Thanks for your help.
Alejandro Casarrubias
Greenhorn

Joined: Sep 21, 2006
Posts: 12

ups i didnt read well. for me
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36513
    
  16
A similar question appears here.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Array bug?
 
Similar Threads
A funny question,see it!!
Your most hated word
Need help in MDB
WA #2 ..... word association
WA #1.....word association