Thursday, 8 August 2013

Java grab data from a specific arraylist, by entering the name?

Java grab data from a specific arraylist, by entering the name?

Let's say you have an array like this:
protected ArrayList<String> client = new ArrayList<String>();
And then you do this:
client.add(ip, username);
What I am trying to do is, grab the username, using the IP. I only have
the IP, I don't have the username, and therefore I need to use the IP to
grab the username.
The IP is unique, can't have the same ip in the same array.
How can I use the IP to get the username?

No comments:

Post a Comment