Java program to do Matrix operation

I have an assignment that states:

2. When you are adding two matrices together, you add similar elements together and place them in a new matrix. Because of this, you need to have matrices with identical sizes. Create a Matrix class, with methods such as add(Matrix a), subtract(Matrix a) and multiplyScalar(double n).

I have no idea where to start, would anyone be able to help:?

Adding matrices the easy way

/*

A Program to add the two matrices

*/

package com.bharat;

import java.util.*;

public class MyNewArrayConcepts {

public static void main(String[] ar){

//creating two dimensional arrays

int[][] arr=new int[3][3];

int[][] arr1=new int[3][3];

Scanner sc=new Scanner(System.in);

System.out.println("Enter elements of first array");

//accepting the elements for first array by taking the help of scanner object present in java.util

for(int i=0;i<arr.length;i++){

for(int j=0;j<arr[i].length;j++){

arr[i][j]=sc.nextInt();

}

}

//accepting the elements for second array by taking the help of scanner object present in java.util

System.out.println("Enter elements of Second array");

for(int i=0;i<arr1.length;i++){

for(int j=0;j<arr1[i].length;j++){

arr1[i][j]=sc.nextInt();

}

}

//Displaying the elements of first array in the matrix form(3*3)

for(int i=0;i<arr.length;i++){

for(int j=0;j<arr[i].length;j++){

System.out.print(arr[i][j]+" \t");

}

System.out.println();

}

System.out.println();

//Displaying the elements of Second array in the matrix form(3*3)

for(int i=0;i<arr1.length;i++){

for(int j=0;j<arr1[i].length;j++){

System.out.print(arr1[i][j]+" \t");

}

System.out.println();

}

//Adding the two matrices and Displaying the result of two matrices

System.out.println("Adding of the matrices");

for(int i=0;i<arr.length;i++){

for(int j=0;j<arr[i].length;j++){

System.out.print(arr[i][j]+arr1[i][j]+" \t");

}

System.out.println();

}

}

}