Java Pet Peeve: Irregular array literals (initialisers)

By which I mean that I can (and have to) write code like:

int[] foo = {1, 2, 3, 5, 7, 11};
testPrimes(foo);

or, even worse:

testPrimes(new int[] {1, 2, 3, 5, 7, 11});

rather than being able to just write:

testPrimes({1, 2, 3, 5, 7, 11});

Post a Comment

You must be logged in to post a comment.