If I do this,
for(int i = 0; i < 10; i++)
{
list.add(0, r.readLine());
}
So, list is an ArrayList, I thought it will add the element on the first position, then, when It will add the second time at the same place, the previous element should've disappeared, but it didn't.
Instead, it kept on adding & telling the elements 'Can you slide to next place?'
😂
General query about adding things in ArrayList
Under discussion
Comments
- Popular
- New
- Old
You must be signed in to leave a comment
This page doesn't have any comments yet