Java Program to read a two dimensional array and print it…

This java program is to read a two dimensional array and print it.
import java.io.*;
class TwoDArray
{
                public static void main(String args [])throws IOException
                {
                                DataInputStream dis=new DataInputStream(System.in);
                                int a[][]=new int[3][2];
                                int i,j;
                                for(i=0;i<3;i++)
                                {
                                                for(j=0;j<2;j++)
                                                {
                                                                System.out.print(“Enter no :”);
                                                                a[i][j]=Integer.parseInt(dis.readLine());
                                                }
                                }
                                for(i=0;i<3;i++)
                                {
                                                for(j=0;j<2;j++)
                                                {
                                                                System.out.print(a[i][j] + ”  “);
                                                }
                                                System.out.println();
                                }
                }

}

Add Comment