Greetings, I had to make a double-dimension array but it does not let me store integer values in that array, however in a dimension yes, why does this happen?
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
int primerDim, segDim;
int cont = 0;
System.out.println("Introduce la primera dimensión: ");
primerDim = sc.nextInt();
System.out.println("Introduce la segunda dimensión: ");
segDim = sc.nextInt();
sc.close();
int[][] doble = new int[primerDim][segDim];
for (int i = 0; i < doble.length; i++)
{
cont++;
doble[i] = cont;
for (int j = 0; j < doble.length; j++)
{
cont++;
doble[j] = cont;
}
}
}