. Advertisement .
..3..
. Advertisement .
..4..
Is there any simple way to store user input into an array java in java?
Array in java is an object containing elements of the same data type. An array is a data structure where identical elements are stored. With arrays in java we can only store a set of elements with a fixed number of elements. Arrays in java store elements by index, the index of the first element is 0. Here is a suggestion for you
You access an array element using the index number.public class TakingInput {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
System.out.println("enter number of elements");
I hope this is a useful