how to reseve input from user in java code example
Example 1: java get input
Scanner sc = new Scanner(System.in);
String s = sc.next();
int n = sc.nextInt();
double d = sc.nextDouble();
float f = sc.nextFloat();
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String s = br.readLine();
int c = br.read();
Example 2: how to read input in java
import java.util.Scanner;
Scanner in = new Scanner(System.in);
while(in.hasNextLine()) {
String line = in.nextLine();
System.out.println("Next line is is: " + line);
}