
how to fill double array in java...?

import java.util.*;
class DoubleArray
{
public static void main(String[] args){
System.out.println("Enter double array values: ");
Scanner input=new Scanner(System.in);
int[][] array = new int[2][2];
for (int i=0 ; i < array.length ; i++)
for (int j=0 ; j < array[i].length ; j++){
array[i][j] = input.nextInt();
}
for (int i=0 ; i < array.length ; i++){
System.out.println();
for (int j=0 ; j < array[i].length ; j++){
System.out.print(array[i][j]+" ");
}
}
}
}

import java.util.*;
class DoubleArray
{
public static void main(String[] args){
System.out.println("Enter double array values: ");
Scanner input=new Scanner(System.in);
int[][] array = new int[2][2];
for (int i=0 ; i < array.length ; i++)
for (int j=0 ; j < array[i].length ; j++){
array[i][j] = input.nextInt();
}
for (int i=0 ; i < array.length ; i++){
System.out.println();
for (int j=0 ; j < array[i].length ; j++){
System.out.print(array[i][j]+" ");
}
}
}
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.