# code for multiplication of matrix in java using methods

code for multiplication of matrix in java using methods April 20, 2011 at 10:55 AM

```   import java.util.*;
class MatrixMultiplication{

public static void main(String[] args){
Scanner input = new Scanner(System.in);
int[][] A = new int;
int[][] B = new int;
int[][] C = new int;
System.out.println("Enter elements for matrix A : ");
for (int i=0 ; i < A.length ; i++)
for  (int j=0 ; j < A[i].length ; j++){
A[i][j] = input.nextInt();
}
System.out.println("Enter elements for matrix B : ");
for (int i=0 ; i < B.length ; i++)
for  (int j=0 ; j < B[i].length ; j++){
B[i][j] = input.nextInt();
}
System.out.println("Matrix A: ");
for (int i=0 ; i < A.length ; i++){
System.out.println();
for  (int j=0 ; j < A[i].length ; j++){
System.out.print(A[i][j]+" ");
}
}
System.out.println();
System.out.println();
System.out.println("Matrix B: ");
for (int i=0 ; i < B.length ; i++){
System.out.println();
for  (int j=0 ; j < B[i].length ; j++){
System.out.print(B[i][j]+" ");
}
}
System.out.println();
System.out.println();
System.out.println("Result is: ");
System.out.println();

for(int i=0;i<3;i++){
for(int j=0;j<3;j++){
for(int k=0;k<3;k++){
C[i][j]+=A[i][k]*B[k][j];
}
}
}
for(int i=0;i<3;i++){
for(int j=0;j<3;j++){
System.out.print(+C[i][j]+" ");
}
System.out.println();
}
}
}
``` October 28, 2011 at 10:12 PM

for(int i=0;i<3;i++){ for(int j=0;j<3;j++){ for(int k=0;k<3;k++){ C[i][j]+=A[i][k]*B[k][j]; } } } It is a super formula for Multiplication of matrix

I also did this by using the following code

for(int i=1,c=1,d=1,p=1,o=1;o<=3;o++,++c,++p){ for(int j=1,q=1;j<=3;j++,++q){
z[p][q]=x[c][d]y[i][j]+x[c][d+1]y[i+1][j]+x[c][d+2]*y[i+2][j]; } }

the codeing which I done seems to be more complicated but I did with only two "for loops"

code for multiplication of matrix in java using methods
code for multiplication of matrix in java using methods  code for multiplication of matrix in java using methods
Parallel multiplication matrix in java
Parallel multiplication matrix in java  hello dear I need parallel multiply matrix in java algorithm to account speed up and efficiency great wishes
Matrix Multiplication in Java
Matrix Multiplication in Java In this Java tutorial we will demonstrate you 'Matrix Multiplication in Java' with the help of a simple example from which you can easily learn how to write a matrix multiplication program in Java
determinant of n*n matrix using java code
determinant of n*n matrix using java code  Here is my code... Scanner(System.in); System.out.println("enter dimension of matrix"); N...]; } System.out.println("enter the elements of matrix"); for(int i=0;i<N;i
parallel dense matrix multiplication
using dense parallel matrix multiplication. I request you to kindly provide me a code for Parallel Matrix multiplication on distributed systems using Java...parallel dense matrix multiplication  hi friends, i am a final year
Matrix Addition using RMI in Java
Matrix Addition using RMI in Java  Source Code for Matrix Addition using RMI in Java
Matrix multiplication in java
Matrix multiplication in java In this section we will learn about multiplication of two matrices. In java this is a simple program to multiply two matrices... two-dimensional array. Here we are going to develop a Java code for matrices
Multiplication of two polynomials using linked list in java
Multiplication of two polynomials using linked list in java  I am doing a program "Multiplication of two polynomials using linked list in java...; Node q = front; //insert in front if exponent is higher
code for a simple java program which performs basic arithmetic operation addition,subtraction,multiplication,division........
code for a simple java program which performs basic arithmetic operation addition,subtraction,multiplication,division........  code for a simple java...,multiplication,division
Display tow dimensional array by matrix form using one for loop in java
Display tow dimensional array by matrix form using one for loop in java  Display tow dimensional array by matrix form using one for loop in java
Multiplication of two Matrix
for multiplying two matrix to each other. Here providing you Java source code... by using the array1.length. After getting both matrix then multiply to it. Both matrix will be multiplied to each other by using 'for' loop. So the output
java code using swings
java code using swings  code that should be able to enter data of student details using all swings into the access database using jdbc connectivity
java program_big digits multiplication..
java program_big digits multiplication..  i want program about big digits multiplication program using java..plz tel me answer
java code using while loop
java code using while loop
java code for PartialSearch using Map????
java code for PartialSearch using Map????  java code for Partial Search using Map
core java ,io operation,calling methods using switch cases
core java ,io operation,calling methods using switch cases  How to create a dictionary program,providing user inputs using io operations with switch cases and providing different options for searching,editing,storing meanings
An application using swings and vector methods
An application using swings and vector methods   Hi, I want an application in Java swings which uses good selection of Vectors methods
multiplication algorithms in java divide and conquer
multiplication algorithms in java divide and conquer  I need multiplication algorithms in java divide and conquer ask from user input two numbers in binary then the program multiply two number use multiplication algorithm in java
multiplication algorithms in java divide and conquer
multiplication algorithms in java divide and conquer  I need multiplication algorithms in java divide and conquer ask from user input two numbers in binary then the program multiply two number use multiplication algorithm in java
multiplication algorithms in java divide and conquer
multiplication algorithms in java divide and conquer  I need multiplication algorithms in java divide and conquer ask from user input two numbers in binary then the program multiply two number use multiplication algorithm in java
java string multiplication
java string multiplication  Is there any simple method of string multiplication in java ..?   public class StringMultiplication { public static void main(String[] args) { String number1 = "17"; String number2
multiplication
multiplication  multiplication of two number numbers entered by user minimum 100digits using GUI   Java Multiplication of two 100 digits number import java.awt.*; import java.math.*; import javax.swing.*; import
multiplication
multiplication  multiplication of two number numbers entered by user minimum 100digits using GUI   Java Multiplication of two 100 digits number import java.awt.*; import java.math.*; import javax.swing.*; import
parsing xml file using java code
parsing xml file using java code  parsing a xml file using java code
Java Matrix Multiplication Example
Java Matrix Multiplication Example In this tutorial, you will learn how... the multiplication of two matrices of any order. In the given program, firstly we have... and then accept the matrix elements as array elements. We have declared two
multiplication function in jsp using scriptlet function
multiplication function in jsp using scriptlet function   how to display data on text filed at total amount??? FlashTemplatesDesign.com Free Css Templates <!-- <form
Reading RDF file using Java code in Eclipse
Reading RDF file using Java code in Eclipse  Could you please tel me what this statement means - Model model = ModelFactory.createDefaultModel