All the posts and topics that contain only an error report will be moved here after the error is corrected. This is to ensure that when users view a question in ETS Viewer, the "Discuss" button will not indicate the presence of a discussion that adds no value to the question.
{ } in your case is part of a syntax for an array definition. You can also do something like String[] sa = { }; and this would define a String[] object. That is just something that the language designers have allowed in the language.
But it is true that { } on its own means nothing at the least and creating a new scope at the most. It doesn't define any object as such. You cannot just write { } and expect to have an object (which is what the code in the given option expects.)
On a second thought, I think you are right. The statement "{ } doesn't define any object" is not clear enough. It should be improved.
Hi Admin,
in your explanation
Object arr[][] = new Object[][] {new String[], {} };
will not compile since new String[] is not valid array initializer - it should contain size or elements, so sth like
new String[5] or new String[]{"string"} would work
Please fix, tnx