0% found this document useful (0 votes)
3 views1 page

Java 2x2 Matrix Example Code

This document defines a Java class that creates a 2x2 integer matrix, assigns values to its elements, and prints out the matrix.

Uploaded by

carlos gerrero
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views1 page

Java 2x2 Matrix Example Code

This document defines a Java class that creates a 2x2 integer matrix, assigns values to its elements, and prints out the matrix.

Uploaded by

carlos gerrero
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

public class Matrices{

public static void main (String args[]){

int numeros [][] = new int[2][2]; /* con esto se indica a java que se
realizara una matriz [][]*/
numeros [0][0] = 5;
numeros [0][1] = 2;
numeros [1][0] = 2;
numeros [1][1] = 5;

[Link]("[" + numeros [0][0] + "]");


[Link]("[" + numeros [0][1] + "]");
[Link]("[" + numeros [1][0] + "]");
[Link]("[" + numeros [1][1] + "]");

}
}

You might also like