+ 1
How can we use scanners in java in basic
3 Respostas
+ 2
you can use more input with Scanner for for example in the first line you can put a String and in the second line you can put a int.
like this:
Scanner settimana = new Scanner(System.in);
String x = settimana.nextLine();
int cassa = settimana.nextInt();
+ 1
Import java.util.Scanner;
class Example{
public static void main(String[] args){
Scanner in = new Scanner(System.in);
String name="";
System.out.println("What's your name?");
name=in.nextLine();
System.out.println("Your name is "+name);
}
}
0
To look at files line per line or, read from user input