+ 1

How can we use scanners in java in basic

24th Feb 2017, 5:07 AM
vijay Vj
vijay Vj - avatar
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();
24th Feb 2017, 8:24 AM
Alessio Farroni
Alessio Farroni - avatar
+ 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); } }
27th Feb 2017, 6:16 AM
Eyasu Mulugeta
Eyasu Mulugeta - avatar
0
To look at files line per line or, read from user input
24th Feb 2017, 5:10 AM
Isley
Isley - avatar