How to write an array to allocate space for 5 things [closed]

You can do it like this:

private Object[] myObjects = new Object[5];

Change the type as needed.

Leave a Comment