mardi 27 septembre 2016

don't understand why the if-statement block of the following snippet is not working?

The following snippet is neither producing any error or any warning, still i am not able to get the desired output. Can you guys please help me?

public static void status(String st){
    System.out.println(st);
    String str[] = st.split(",");
    Iterator it = array.iterator(); //ArrayList contains csv imported values
    while(it.hasNext()){
        Employee emp = (Employee) it.next();
//Employee is a class with getter and setter
//If part is not working
        if(emp.getName().equalsIgnoreCase(str[0]) && emp.getEmail().equalsIgnoreCase(str[1])){
            emp.setStatus("O");

        }
        else{
            System.out.println();
        }
    }

}

Aucun commentaire:

Enregistrer un commentaire