How does List <Integer> in Java distinguish between element and index when an integer is passed?

In a sheet of an abstract type, how does it determine the argument is an index or an element? For example, if a LinkedList calls remove (1), how does the computer know if it is removing a second element or an integer element with a value of 1?

Thank!

+3
java arraylist linked-list list


source to share


No one has answered this question yet

See similar questions:

154
Correctly removing an integer from a <Integer> list

or similar:

3324
How to generate random integers in a specific range in Java?
1782
How can I get the number of items in a list?
1315
How do I remove an item from a list by index?
1270
Why not inherit from List <T>?
1249
How does the Java loop for each loop work?
707
Fastest way to check if a value exists in a list
697
How to create a new list in Java
625
How do I join two lists in Java?
593
IEnumerable vs List - which should I use? How do they work?
589
How do I convert a map to a list in Java?



All Articles
Loading...
X
Show
Funny
Dev
Pics