make nextId fields private
Check for nothing entered in getLine()