In java when you defined some variable inside the method parameters(these variables are also local variables but if you want to be more specific you can call these variables as parameterized variables or arguments ) or within a method we called them as local variables. So these variables have their life time only within the scope (Scope means the closest curly braces they are surrounded with) So in here you are trying to define two local variables within the same scope with the same name,so that's why you are getting that compile time error.
SOLUTION:
But regarding what you are trying to it's completely useless because you are trying to assign new variable name in the runtime it's totally useless and I don't think it will be possible to do like a language with java which is not using dynamic variables.
Best practices: Try to use camel case to define variables ---->scannerName would be better.