11th Apr 2017, 6:28 AM
Nikhil
2 Answers
+ 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]
11th Apr 2017, 12:02 PM
Krishna Teja Yeluripati
Krishna Teja Yeluripati - avatar
+ 1
thanks a lot
11th Apr 2017, 12:28 PM
Nikhil