why do you say x is a variable at private scanner xThe code doesn't actually say it's a variable, but it is. It is a reference of type Scanner. As it isn't initialized in the declaration, its initial value is null.
and then make x an object?It doesn't. it creates a new Scanner instance and then assigns the reference to 'x'.
why do both variable and object?You should now be able to see that the question is meaningless.