How can I determine if an array is full?

Say I construct an array of length equal to arraySize.How can I know if the array is full?Is there a way knowing if some the array positions are null?
[185 byte] By [stels] at [2007-9-26 3:09:54]
# 1
Object[] array = new Object[10];if (array[array.length - 1] == null)// array is not "full" Is that what you're looking for?
schapel at 2007-6-29 11:16:01 > top of Java-index,Archived Forums,Java Programming...
# 2
as far as i know, the only way is to loop through the array and manually check for null.
schillj at 2007-6-29 11:16:01 > top of Java-index,Archived Forums,Java Programming...
# 3

public class ArrayTester

{

public static boolean isArrayFull(Object[] array)

{

if (null == array)

throw new IllegalArgumentException("null array");

for (int i = 0; i < array.length; ++i)

{

if (null == array[i])

return false;

}

return true;

}

}

pholser at 2007-6-29 11:16:01 > top of Java-index,Archived Forums,Java Programming...