Have a look here:
Comparing Strings and Portions of Strings[
^]
As i mentioned in comment, you have to operate on data, not on strings. Java is really powerful programming language. It enables to create custom classes, such as
public class Player{
public String Name;
public Int Score;
public Player(String n, Int s){
Name = n;
Score = s;
}
public toString() {
return Name + "'s score is: " + Score.toString();
}
}
ArrayList<player> players = new ArrayList<player>();
players.Add(new Player("Adam", 50));
players.Add(new Player("Eve", 55));
Player player1 = players.get(0);
Player player2 = players.get(1);
if(player1.equals(player2)){
}
Do you see the difference?
For further information about comparing objects in Java, please see:
Java Programming: Comparing Objects[
^]