+ 1
What is the code to input something in java?
2 Answers
+ 2
There is another way of input which is known as BufferedReader. It is described in this code:
https://code.sololearn.com/cM5LBqctY4G8/?ref=app
+ 1
At the top, you write :
import java.util.Scanner;
In your function, you write:
Scanner scanner = new Scanner (System.in);
String string = scanner.nextLine();
String string2 = scanner.next ():
int integer = scanner.nextInt();
and other scanner functions.