Java Integer Array Create intArrayContains(int val, int[] array)

Here you can find the source of intArrayContains(int val, int[] array)

Description

Returns true if int array 'array' contains value 'val'.

License

Open Source License

Declaration

public static boolean intArrayContains(int val, int[] array) 

Method Source Code

//package com.java2s;
//   it under the terms of the GNU General Public License as published by

public class Main {
    /**/*from w  w  w. j a v a 2s  .c  o m*/
     * Returns true if int array 'array' contains value 'val'.
     */
    public static boolean intArrayContains(int val, int[] array) {
        for (int i = 0; i < array.length; i++)
            if (val == array[i])
                return true;
        return false;
    }
}

Related

  1. intArray(double a, double b, double c)
  2. intArray(int len)
  3. intArray(Integer... values)
  4. intArray(String data)
  5. intArrayConcat(int[] a, int[] b)
  6. intArrayContains(int[] array, int key)
  7. intArrayEquals(int[] a1, int[] a2)
  8. intArrayFromString(final String data)
  9. intArrayFromString(String record)