Hello,
I am having issues understanding the concepts of positions. What are their purpose and how do they work? My resources say this:
-It gives a unified view of diverse ways of storing data, such as:
– a cell of an array
– a node of a linked list
-Just one method:
- object element():
returns the element stored at the position
I don't really understand this. I understand they return an element, but how does it know which element to return. If you were to implement positions with an array for example, would each block of the array point to a position object that would then return an element. I am confused.