I found this question (due to a new answer bumping it) and asked myself what the real question is, because it looks like OP already knows how to read console input using the Scanner class.
So I checked the edit history to find the original question. There, you can see that an anonymous user edited an answer into the question and the suggested edit was approved during the review process by two other users.
Now, I don't know how to treat this question and edit correctly.
My problem is, that in this state the question makes no sense to me. It answers itself and the provided answers seem to repeat that knowledge. On the other hand, this edit is more than two years old, so other users don't seem to have a problem with it. Especially Jamal, who is an experienced user in my eyes, kept the edit like it was and edited other stuff instead.
So I would like to know how to treat such old edits. Should I restore the old code example and original meaning of the question, or should I keep it like it is, because it is not such a big deal?
According to this Q&A, I (or someone else) should restore the old code example, to make it clear that OP didn't know how to read user input from the console, right?