You need to sign in to do that
Don't have an account?

How to add a list value to templist?
How to add a list value to templist?
for eg:
list A - 10 rows value
templist .add(listA);
list A.clear();
list A - 7 rows value
templist .add(listA);
In o/p = templist have 17 row values
Something like this?:
List<String> listA = new List<String>{'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J'};
List<String> listTemp = new List<String>();
listTemp.addAll(listA);
//Assert Temp List has 10 items.
System.assertEquals(10, listTemp.size());
listA.clear();
listA.addAll(new List<String>{'K', 'L', 'M', 'N', 'O', 'P', 'Q'});
listTemp.addAll(listA);
//Assert Temp List has 17 items.
System.assertEquals(17, listTemp.size());