First, you have to instantiate the Scanner, like so:
Scanner scanner = new Scanner(System.in); //if you want to read from the console
Then, you can receive your input.
String n = scanner.nextLine();
Make sure you close your scanner when you don't need it anymore:
scanner.close();