Adding two matrices in Java

We can add two matrices in java using multi-dimensional arrays. In java "array of arrays " approach is used for create multi-dimensional array Examples:We have two matrices A and B…