About 29,800,000 results
Open links in new tab
  1. Searching Elements in an Array | Array Operations - GeeksforGeeks

    May 23, 2024 · In this post, we will look into search operation in an Array, i.e., how to search an element in an Array, such as: Searching in an Unsorted Array using Linear Search; Searching …

  2. How do I determine whether an array contains a particular value in Java

    Jul 15, 2009 · You can use the Arrays class to perform a binary search for the value. If your array is not sorted, you will have to use the sort functions in the same class to sort the array, then …

  3. Check if a Java Array Contains a Value - Baeldung

    Sep 7, 2024 · In this article, we’ll look at different ways to search an array for a specified value. We’ll also compare how these perform using JMH (the Java Microbenchmark Harness) to …

  4. 4 Ways to Search Java Array to Find an Element or Object - Blogger

    Aug 11, 2021 · Since Java programmer uses array a lot, they often faced challenges to search element in Java array e.g. How to check if array contains an element or not. This Java tutorial …

  5. Check If a Value is Present in an Array in Java - GeeksforGeeks

    Apr 15, 2025 · There are numerous approaches to check whether a specific element is present in this Array or not in Java. These are, Using the Linear Search method; Using the Binary Search …

  6. Finding an element in an array in Java - Stack Overflow

    Nov 25, 2013 · With Java 8, you can do this: int[] haystack = {1, 2, 3}; int needle = 3; boolean found = Arrays.stream(haystack).anyMatch(x -> x == needle); You'd need to do . boolean …

  7. Java Array Search Examples - Online Tutorials Library

    Java Array Search Examples - Explore various examples of searching elements in Java arrays with clear explanations and code snippets.

  8. How to Search an Array in Java - Learning about Electronics

    In this article, we show how to search an array in Java. Searching an array, no matter what language you are using, can be done with a for loop. Searching arrays can always be done …

  9. Arrays.binarySearch() in Java with Examples | Set 1

    Nov 25, 2024 · In Java, the Arrays.binarySearch() method searches the specified array of the given data type for the specified value using the binary search algorithm. The array must be …

  10. How to check if Array contains given Number or String in Java

    That's all on how to find if an array contains a particular value or not. As I told you, if you are allowed to use Java API, then you can either use the binarySearch() method of Java Java …

  11. Some results have been removed
Refresh