You never set these first and last variables. Right now String first is left as null, and string last is left as "" so this comparison doesn't work.