• Tejashree Suryawanshi 10
  • NEWBIE
  • 0 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

Hi All,

 

I am trying to implement the three dimension array in apex, could any one let me know where I am getting struck.

/* Here goes my java snippet */
private static int[][][] MAX_LENGTH = {
        { {41,  25,  17,  10},  {34,  20,  14,  8},   {27,  16,  11,  7},  {17,  10,  7,   4} },
        { {77,  47,  32,  20},  {63,  38,  26,  16},  {48,  29,  20,  12}, {34,  20,  14,  8} },        
        { {461, 279, 192, 118}, {365, 221, 152, 93},  {259, 157, 108, 66}, {202, 122, 84,  52} },
        { {552, 335, 230, 141}, {432, 262, 180, 111}, {312, 189, 130, 80}, {235, 143, 98,  60} }};
/* Apex Snippet */
private static List<List<List<Integer>>> MAX_LENGTH = {
       List<Integer> { List<Integer>{41,  25,  17,  10}, List<Integer> {34,  20,  14,  8},  List<Integer> {27,  16,  11,  7},  List<Integer>{17,  10,  7,   4} },
       List<Integer> { {77,  47,  32,  20},  List<Integer>{63,  38,  26,  16},  List<Integer>{48,  29,  20,  12}, List<Integer>{34,  20,  14,  8} }, 
       List<Integer> { List<Integer>{461, 279, 192, 118}, List<Integer>{365, 221, 152, 93},  List<Integer>{259, 157, 108, 66}, List<Integer>{202, 122, 84,  52} },
      List<Integer>  { List<Integer>{552, 335, 230, 141}, List<Integer>{432, 262, 180, 111}, List<Integer>{312, 189, 130, 80}, List<Integer>{235, 143, 98,  60} }
};

 It would be appreciative if any one could give there ideas or solution. Thanks in advance.

Regards ,

Zubair Haris.