Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要确保某个 long 值不在数组中。但由于某种原因,这不起作用......
!d.toString().contains(sq.toString());
我确信我得到了一些真正倒退的东西......但我不知道是什么!
尝试
!Arrays.asList(d).contains(sq);
查看 java.util.Arrays 中的静态方法。您的数组需要进行排序才能使 binarySearch() 工作。