There is a contains
method for lists, so you should be able to do:
Arrays.asList(yourArray).contains(yourObject);
Warning: this might not do what you (or I) expect, see Tom’s comment below.
More Related Contents:
- Java: Finding duplicate in array [closed]
- How to remove repetition in output results in this code
- ArrayOutOfBoundsException Error?
- how to change code this into recursion Java? [closed]
- java array of booleans all set to the same value [closed]
- Reverse element in array without array reverse method [closed]
- Finding index of array of 2nd occurring element
- Create ArrayList from array
- Removing an element from an Array (Java) [duplicate]
- Why does the toString method in java not seem to work for an array
- Generic arrays in Java
- Is an array a primitive type or an object (or something else entirely)?
- How can I check whether an array is null / empty?
- How to initialize an array of objects in Java
- comparing arrays in java
- Sorting 2D array of strings in Java
- Why does Collections.sort use Mergesort but Arrays.sort does not?
- Find the most popular element in int[] array
- How does the Java array argument declaration syntax “…” work?
- Write a mode method in Java to find the most frequently occurring element in an array
- Add JsonArray to JsonObject
- Java Arrays.equals() returns false for two dimensional arrays
- How to clone a multidimensional array in java? [duplicate]
- How to check if array is already sorted
- How to access nested elements of json object using getJSONArray method
- Why can I edit the contents of a final array in Java?
- How to manipulate arrays. Find the average. Beginner Java
- Time Complexity for Java ArrayList
- How to deep copy an irregular 2D array
- java: Arrays.sort() with lambda expression