How to enter an array lenght? : Sorry for stupid question, just started oop.
Tried to enter the length of array using .lengh, but got mistake.
Was exactly wrong?

    import java.util.*;
    public class Storage {
	public static int i = 0, size;
    static int[] number;
	
	public static void main (String[] args) {
		Scanner input = new Scanner(System.in);
		System.out.println("What is the value of array?");
		number = new int [input.nextInt()];
		System.out.println("Write the numbers:");
		
		for (int i : number) {
			number[i] = input.nextInt();
		}
		System.out.println("Array:");
		System.out.println(Arrays.toString(number));
	}
    }