Java Array Contain arrayContains(int[] array, int value)

Here you can find the source of arrayContains(int[] array, int value)

Description

array Contains

License

Open Source License

Declaration

public static int arrayContains(int[] array, int value) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static int arrayContains(int[] array, int value) {
        int index = 0;
        for (; index < array.length; index++)
            if (array[index] == value)
                break;
        if (index < array.length)
            return index;
        else/*  w ww.  j ava 2  s . c o  m*/
            return -1;
    }
}

Related

  1. arrayContains(final String[] array, String needle)
  2. arrayContains(final T[] array, final T v)
  3. arrayContains(int[] arr, int e)
  4. arrayContains(int[] arr, int ii)
  5. arrayContains(int[] array, int value)
  6. arrayContains(Object obj, Object[] array)
  7. arrayContains(Object[] a, Object ob)
  8. arrayContains(Object[] array, Object el)
  9. arrayContains(Object[] array, Object el)