Can I get help to display 4 ints from scanner? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Can I get help to display 4 ints from scanner?

I would like to scan input of 4int, put in int[]values, and then display values entered. Last value displays incorrectly as 0. https://code.sololearn.com/cw52oA3a9keg/?ref=app

16th Jun 2018, 12:26 AM
LottoMan
1 Answer
+ 7
Remove the -1 from values.length - otherwise, you don't access the last index.
16th Jun 2018, 12:35 AM
Tamra
Tamra - avatar