+ Start a Discussion
URVASHIURVASHI 

List<list<String> Apex Salesforce

Hi any anyone explain me the concept of 2 array using list<list<String>>.

How to access individual elements of both the list.

 

if suppose i have

 List<List<String>> HeaderDataC = new List<List<String>>();
    List<String> list1 = new List<String>();
    List<String> list2 = new List<String>();

list1.add('val1');

list1.add('val2');

list2.add('1');

list2.add('2');

 

    HeaderDataC.add(list1);
    HeaderDataC.add(list2);

 

but here what represents row data n what represents column data.

and if suppose i wana insert value in specific row of specific column,how do i achive it?

like HeaderDataC[2][3]?

 

Thanks in advance.

Best Answer chosen by Admin (Salesforce Developers)