find Value In Array - Android java.lang

Android examples for java.lang:array

Description

find Value In Array

Demo Code


//package com.java2s;

public class Main {
    public static int findValueInArray(Object[] array, Object value) {
        for (int i = 0; i < array.length; i++) {
            if (array[i].equals(value))
                return i;
        }//from w w w . j av  a  2  s  .c  om
        return -1;
    }
}

Related Tutorials