So i'm having a hard time, finding ways on how to put integers inside the array, my objective is, make a program that a user will store 10 numbers and then after that display it.
So this is what I've done so far:
import java.util.Scanner;
public class wtf {
public static void main(String args[]){
Scanner input = new Scanner(System.in);
int array[] = new int[10];
for(int i=1;i<array.length;i++){
System.out.print("Enter a number: ");
array[] = input.nextInt();
}
}
}
But unfortunately there is an error.