0 votes
in JAVA by
How to take input from user in java?

1 Answer

0 votes
by

"import java.util.Scanner;

  Scanner console = new Scanner(System.in);

  int num = console.nextInt();

  console.nextLine() // to take in the enter after the nextInt() 

  String str = console.nextLine();"

Related questions

0 votes
asked Oct 10, 2020 in JAVA by Robindeniel
0 votes
asked Oct 21, 2020 in JAVA by rahuljain1
...