get Length Of Dynamic Array - Android java.lang

Android examples for java.lang:array resize

Description

get Length Of Dynamic Array

Demo Code


//package com.java2s;

public class Main {
    public static int getLengthOfDynamicArray(Object[] array) {
        int max_length = array.length;
        for (int actual_length = 0; actual_length < max_length; actual_length++) {
            if (array[actual_length] == null)
                return actual_length;
        }//  www  .  j ava  2  s.c o  m
        return max_length;
    }
}

Related Tutorials