Answer to Question #207090 in Java | JSP | JSF for Ronnie

Question #207090

Explain your own example programming application in which you can effectively use a multidimensional array (or sequence type) to organize the data.



1
Expert's answer
2021-06-15T01:29:30-0400

Multidimensional array can be used in adding two matrices.

Example




public class Main
{
	public static void main(String[] args)
    {
  
        int[][] array1 = { { 1, 2 }, { 3, 4 } };
        int[][] array2 = { { 5, 6 }, { 7, 8 } };
        for (int i = 0; i < 2; i++) {
            for (int j = 0; j < 2; j++) {
                int n=array1[i][j]+array2[i][j];
                System.out.print(n + "\t");
            }
  
            System.out.println();
        }
    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS