Hi i have a question about ArrayList in Java.
I have in a class called "Utente" an ArrayList ricFriends; Now, the problem is that i have a method called
requestFriendship(Utente u)
where i want to add in the u.ricFriends the object Utente that call the method...
I tried in this way but it's at 99% wrong..
public void requestFriendship(Utente u){
u.ricFriends.add(this);
}
for example i want to do this :
Utente Gary = new Utente();
Utente Mike = new Utente();
Gary.requestFriendship(Mike);
And if i check Mike.ricFriends i can see the object Gary;
Sorry for the english, thank you.