how to convert this scanf in java? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

how to convert this scanf in java?

how to conver this scanf("%d,&a[i]); in java? i already have Scanner scan = newScanner(System.in)

16th Sep 2020, 1:56 AM
Lia Costa ✨
Lia Costa ✨ - avatar
1 Answer
0
// for scan integer from standard input int i=0, a[] = new int[5]; Scanner sc = new Scanner(System.in); a[i] = sc.nextInt(); there is also Scanner.findInLine(regex) for more complex format scan
16th Sep 2020, 5:58 AM
zemiak