Take the 2-minute tour ×  I'm new to java so im having some
"annoying" problems. I have a class Employee which contains an
int idNumber and a int phone number. Then I have a
LinkedList<Employee> sorted by idNumber. I want to change the
phonenumber of a certain idnumber. I've been working with
Iterators but i don't know if i'm doing it right, which I doubt.
public void setNewPhoneNumber(int idnumber, int newphone){
Iterator<IndexC> it = listEmployee.iterator();            IndexC
employeeTemp = null;          boolean found = false;
while(it.hasNext() && !found){                  employeeTemp =
it.next();                 if(employee.getIdNumber()==
idnumber){                     found = true;   Yeah, I know
employee.setNewPhoneNumber is wrong, but I don't know which the
correct way change the value on the linkedlist. (Sorry for the
bad english, not a native speaker)  share|improve this question
Doesn´t that work? What error do you get? Why do you think it
wouldn´t work? –  Tom May 9 '09 at 0:47