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;}


本文标签: 原码 二进制