Java的List类里会有index,经由过程index能够获得列表内里的值就是个整型值。
能够经由过程indexOf(object o )返回列内外对象的索引。
List中Indexof用法(推断是不是存在)
string str = "aa"; ArrayList list = new ArrayList(); list.Add("bb"); list.Add("aa"); list.Add("cc"); if (list.IndexOf(str) == -1) { list.Add(str); }
以上就是java中index什么意思?的细致内容,更多请关注ki4网别的相干文章!