This time I will use Scanner. Write this line on the first line import java.util.Scanner;
Prepare in main. Scanner sc = new Scanner(System.in);
Receive the input where you want it and assign it to a variable. int x = sc.nextInt (); // If you want to take an integer String s = sc.next (); // If you want to take a string
Recommended Posts