Object[] arr = new Object[Integer.MAX_VALUE];
This is throwing exception
Exception in thread "main" java.lang.OutOfMemoryError: Requested array size exceeds VM limit
Object[] arr = new Object[Integer.MAX_VALUE];
This is throwing exception
Exception in thread "main" java.lang.OutOfMemoryError: Requested array size exceeds VM limit