Jump to Real's How-to Main page

Initialize multidimensional array

Simply use braces...
  static double[][] Rates = {
    {0.50, 0.70,  0.40, 0.60},
    {0.50, 1.10,  0.50, 0.80},
    {0.80, 1.60,  0.70, 1.20},
    {1.50, 2.90,  1.20, 2.10},
    {2.50, 4.90,  2.00, 3.30},
    {4.60, 8.50,  3.20, 5.00},
    {6.40,11.00,  4.10, 6.00}
};

If you find this article useful, consider making a small donation
to show your support for this Web site and its content.

Written and compiled by Réal Gagnon ©1998-2005
[ home ]