Java program for arithmetic operations on matrix