Logo

Programming-Idioms

History of Idiom 26 > diff from v77 to v78

Edit summary for version 78 by ad:
[Java] asd

Version 77

2020-10-10, 20:07:46

Version 78

2021-05-30, 15:52:31

Idiom #26 Create a 2-dimensional array

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

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
Variables
x,m,n
Variables
x,m,n
Code
double[][] x = new double[m][n];
Code
char[][] x = new char[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