I come from a php background and in php, there is an array_size() function which tells you how many elements in the array are used.
array_size()
Is there a similar
If you want a function to do this
Object array = new String[10]; int size = Array.getlength(array);
This can be useful if you don't know what type of array you have e.g. int[], byte[] or Object[].