+ 1
Can anyone check this code
2 Réponses
+ 7
To use Scanner, you need to use
import java.util.Scanner;
And, you are scanning only the length of array but not the elements of the array. Use myArr[i] = in.nextInt() inside the for loop to scan.
Change "elements are"+myArr to "elements are"+myArr[i]
+ 1
thanks a lot