I have an arraylist called election(). Why isn't code this reassigning the name variable like it should.
private static void replaceName(String oldName, String newName){
Candidate c;
for(int i = 0;i<election().size();i++){
c = election().get(i);
if(c.name == oldName){
election().get(0).name = newName;
System.out.println(election().get(0).getName());
}
}
}