Help Needed.. Java Beginner
It's about ArrayList
In the documentation it says that the set and remove methods both return an object then how come we don't need to save the reference of it anywhere ?
here are the two possibilities..
public java.lang.Object remove(int);
public java.lang.Object set(int, java.lang.Object);
Saving the refernece of the returned Objects
Team t3 = players.set(1,new Team("Rooney",12000,2));
Team t4 = players.remove(2);
It also works the other way around