you have not initialized the factorial and input.
take the reference of scanner with different name then assign that reference to input with nextLine() method.
then it will be compiled.