Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 180
  • Last Modified:

how can i set both chargelists in the arraylist




if(billingModel.getICStatusChargesList() != null)
billingModel.setChargesList(billingModel.getICStatusChargesList());

if (billingModel.getChargesList() != null)
i want to add all to billingModel.setChargesList(billingModel.getChargesList() )

both getICStatusChargesList() and getChargesList() to be added in billingModel.setChargesList()
0
chaitu chaitu
Asked:
chaitu chaitu
1 Solution
 
chaitu chaituAuthor Commented:
why i am getting classcastexception if i write this

 billingModel.setChargesList((ArrayList)billingModel.getChargesList().set(0,billingModel.getICStatusChargesList()));
0
 
aozarovCommented:
ArrayList arrayList = new ArrayList(billingModel.getICStatusChargesList());
arrayList.addAll(billingModel.getChargesList());
billingModel.setChargesList(arrayList);
0

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now