your code:
String item; // a String object
while (item != 999) // String compares to integer

You are comparing a String object to an integer. if you want that kind of comparison, you better...