Hello!...
java enthusiasts. I have a question about arrays, hope you can provide me an explanation. I don't understand why the compiler acts so weird in this case:
The preceding code compiles with no errors, But when you run the program it throws an ArrayOutOfBoundsException. it's understandable because there's no element at that position,
But Why Does the compiler allow that syntax? --> (
{1,2,})
A comma and then no element... the compiler should freak out. Well, That would be my query.
Have a nice day,
Jose