function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
vijendhar k 16vijendhar k 16 

expecting right curly bracket, found '{'

Hi all,
List<List<Integer>> listOfListInt = new List<Integer> { {0, 1, 2, 3}, {3, 2, 1, 0}, {3, 5, 6, 1}, {3, 8, 3, 4} };  After executeig the code in developer console i am getting follwing error
Line: 1, Column: 56
expecting right curly bracket, found '{'
Please help me fix error
Thanks

 
Omveer kundu 8Omveer kundu 8
Hi Try This
List<List<Integer>> listOfListInt = new List<List<Integer>>{new List<Integer>{0'1,2,3},new List<Integer>{3,2,1,0},new List<Integer>{3,5,6,1}};
JeffreyStevensJeffreyStevens
List<List<Integer>> listOfListInt = new List<List<Integer>>{new List<Integer>{0,1,2,3},new List<Integer>{3,2,1,0},new List<Integer>{3,5,6,1}};
    system.debug('listOfListInt='+ListOfListInt);

Omveer had an extra ' in the first list.  vjendhar had the instansatation wrong (after the = sign)  - should have been = new list<list<integer>> ..
Ansh CoderAnsh Coder
Hi,
use this format
List<List<integer>> names = new List<List<integer>>
{
    new List<integer>{1, 1, 9},
    new List<integer>{1, 2, 0},
    new List<integer>{1, 3, 6},
    new List<integer>{1, 4, 5, 2}
};

 
Omveer kundu 8Omveer kundu 8
Yeah By Mistake
pls try this
List<List<Integer>> listOfListInt = new List<List<Integer>>{new List<Integer>{0,1,2,3},new List<Integer>{3,2,1,0},new List<Integer>{3,5,6,1}};

 
vijendhar k 16vijendhar k 16
Thanks to all for reply , your work is appreciable  , it helped me lot :)