I am required to write a simple matrix program and swap the diagonal.Given the input 1 2 3 4 5 67 8 9After swapping the diagonal it should be3 2 14 5 69 8 7Here is my code:public static void main(String[] args) {    int i,j = 0,m,k;    int Number[][] = new int [3][3];    Scanner scanner = new Scanner(System.in);    System.out.println(Enter the elements of matrix);    for(i=0;i<=2;i++)    {        for(j=0;j<=2;j++)        {            m = scanner.nextInt();            Number[i][j] = m;        }    }    System.out.println(This is the original matrix);    for(i=0;i<=2;i++)    {        for(j=0;j<=2;j++)        {            System.out.print(Number[i][j]+\t);        }        System.out.println();    }    //Swapping    for(i=0;i<=3;i++)    {        k=Number[i][j];        Number[i][j] = Number[i][3-i-1];        Number[i][3-i-1] = k;    }    for(i=0;i<=2;i++)    {        for(j=0;j<=2;j++)        {            System.out.print(Number[i][j]+\t);        }        System.out.println();    }}
Swapping the diagonals of a matrix
java;matrix;homework