Skip to content

Instantly share code, notes, and snippets.

@karellism
Created February 15, 2019 08:40
Show Gist options
  • Save karellism/b32fc835456850996d67cd1556c3c49e to your computer and use it in GitHub Desktop.
Save karellism/b32fc835456850996d67cd1556c3c49e to your computer and use it in GitHub Desktop.
How to get the user input using Scanner. Here the input is an integer that will be stored in int variable i.
Scanner sc = new Scanner(System.in);
int i = sc.nextInt();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment