java判断数据是否包含元素

java判断数据是否包含元素

Integer[] ids = new Integer[]{1, 2, 3, 4};
if (Arrays.asList(ids).indexOf(1) != -1) {
    return "contains";
}
发布了191 篇原创文章 · 获赞 23 · 访问量 12万+

猜你喜欢

转载自blog.csdn.net/pureszgd/article/details/103344968