Results 1 to 2 of 2

Thread: Int Array

  1. #1

    Thread Starter
    Member Motaro's Avatar
    Join Date
    Apr 2008
    Posts
    62

    Int Array

    I have an array and an int:

    Code:
    public static final int array[] = {0, 1, 3...}; //This array contains 104 numbers.
    int i = 500;
    I want to be able to check if a certain number is in that array.

    I want something like this:

    Code:
    if(i = array)
    {
    code...
    }

  2. #2
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: Int Array

    You want to search the Array, use "java.util.Arrays.binarySearch" method
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width