How to avoid Index Out Of Boundary Exeption
1. Use fori iterate, get the index
2. current index has to less than list size minus one
For example:
[1,2,3,4,5] size is 5
Index (4) is the last element, which is 5
So index number has to be less than 4, which is the (size -1)
if (deviceInfos.size() -1
原创
2020-09-09 18:09:21 ·
116 阅读 ·
0 评论