Hi all,
I'm trying to understand the solution given by CG. Can someone explain Line 37? why would Index ever be less than 0? Doesn't index starts at 0 and increase after that? Also, why is that needed? (I tried to run it commenting out L37, but it wouldn't). Thanks for the input.
Explanation on Line 37
Resolved
Comments (2)
- Popular
- New
- Old
You must be signed in to leave a comment
Thomas
18 May 2021, 16:35
indexOf(Object o) returns -1 if o is not in the list
https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html#indexOf-java.lang.Object-
+1
ImDevin
18 May 2021, 19:16
ok. that makes sense. Thx for the input Thomas! 👍
0