Java Array Length Get length(Object[] array)

Here you can find the source of length(Object[] array)

Description

length

License

Open Source License

Declaration

public static int length(Object[] array) 

Method Source Code

//package com.java2s;
/**//from ww w .  j  a v a2 s.c o  m
 * Aptana Studio
 * Copyright (c) 2005-2011 by Appcelerator, Inc. All Rights Reserved.
 * Licensed under the terms of the GNU Public License (GPL) v3 (with exceptions).
 * Please see the license.html included with this distribution for details.
 * Any modifications to this file must keep this entire header intact.
 */

public class Main {
    public static int length(Object[] array) {
        if (isEmpty(array)) {
            return 0;
        }
        return array.length;
    }

    public static boolean isEmpty(Object[] array) {
        return array == null || array.length == 0;
    }
}

Related

  1. length(float[] color)
  2. length(int[] tail)
  3. length(int[][] instance, int u)
  4. length(long[] v)
  5. length(Object anArray[])
  6. length(Object[] array)
  7. length(Object[] array)
  8. length(Object[] buf)
  9. length(String[] arr)