in my code i have a for that it repeat 100 time for {lg0 , lg1 , samsong0 ,...}
{lg0 , lg1 , samsong0 ,...} is list of some class that they have static List
for (int i = 0;i < lg0.brandStringList.length ; i++ )
{
MobileInformation mobile = new MobileInformation();
mobile.Alert_types = lg0.Alert_typesStringList[i];
.
.
.
mobile.Video = lg0.VideoStringList[i];
}
one way for Solving problem is writting 100 for that is not good way.
for ex:
if i have {lg0 , lg1} i must write below code
for (int i = 0;i < lg0.brandStringList.length ; i++ )
{
MobileInformation mobile = new MobileInformation();
mobile.Alert_types = lg0.Alert_typesStringList[i];
.
.
.
mobile.Video = lg0.VideoStringList[i];
}
for (int i = 0;i < lg1.brandStringList.length ; i++ )
{
MobileInformation mobile = new MobileInformation();
mobile.Alert_types = lg1.Alert_typesStringList[i];
.
.
.
mobile.Video = lg1.VideoStringList[i];
}
Question
How i can make a List for all Class and optimize above code by using it.
brandStringList,Alert_typesStringList,VideoStringList...)?lg1,lg0...