Hello everyone, There is something weird with my loop I can't understand. Here is my loop now : while(true) { String s = reader.readLine(); if(s.isEmpty() || s == "") break; else { listCat.add(CatFactory.getCatByKey(s)); } } The code seems to work when it is written like this. Nonetheless, if I change it like this while(true) { if(reader.readLine().isEmpty() || reader.readLine() == "") break; else { listCat.add(CatFactory.getCatByKey(reader.readLine()); } } I get an error. The only difference is using a String variable instead of raw using reader.readLine(). What is wrong ?