srinivas sy wrote:will it store only one element? or 10 elements(size) will it store? . . .
If you mean nextInt, that doesn't store anything. If you use nextInt to fill an array in a loop, it still returns one
int at a time. [You doubtless know a Java® method returns one thing and always one thing, unless it is marked void.]
If you fill a ten‑element array using nextInt, then nextInt runs ten times.