Prev Next

Java / Arrays

Can we declare array size as negative?

No, it is not possible to declare array size as negative. We won't get any compile-time error however we will encounter NegativeArraySizeException at run-time.

More Related questions...

Show more question and Answers...


Comments & Discussions