Logo

Programming-Idioms

History of Idiom 26 > diff from v78 to v79

Edit summary for version 79 by programming-idioms.org:
Restored version 77: real numbers -> double in Java

Version 78

2021-05-30, 15:52:31

Version 79

2021-06-02, 19:57:32

Idiom #26 Create a 2-dimensional array

Declare and initialize a matrix x having m rows and n columns, containing real numbers.

A matrix with iteration variables i for rows and j for columns

Idiom #26 Create a 2-dimensional array

Declare and initialize a matrix x having m rows and n columns, containing real numbers.

Variables
x,m,n
Variables
x,m,n
Code
char[][] x = new char[m][n];
Code
double[][] x = new double[m][n];
Comments bubble
Initial values are 0.0
m and n need not be known at compile time
Comments bubble
Initial values are 0.0
m and n need not be known at compile time
Demo URL
http://ideone.com/tWa2Nf
Demo URL
http://ideone.com/tWa2Nf