admin 管理员组文章数量: 887021
2024年1月17日发(作者:56 10 的八位二进制原码)
/*** Returns true
if this
list
contains
the specified element.* More formally, returns true
if
and only
if this
list
contains*
at least one element e such
that* (o==null ? e==null : (e)).** @param o element
whose presence
in this
list
is
to be tested* @return true
if this
list
contains
the specified element*/public
boolean
contains(Object o) {return indexOf(o) >=
0;}/*** Returns
the index
of
the
first occurrence
of
the specified element*
in this
list,
or -1
if this
list
does not contain
the element.* More formally, returns
the lowest index i such
that* (o==null ?
get(i)==null : (get(i))),*
or -1
if there
is no such index.*/public int indexOf(Object o) {if (o == null) {for (int i =
0; i < size; i++)if (elementData[i]==null)return i;}
else {for (int i =
0; i < size; i++)if ((elementData[i]))return i;}return -1;}
版权声明:本文标题:java两个list中保存bean对象,找出其中某一属性不同的元素 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.freenas.com.cn/free/1705426212h484312.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论