I try to add two arraylist into single arraylist. all arraylist object type is different.
here my two arraylist-
ArrayList<NewsItem> topnewslist=new ArrayList<>();
ArrayList<LatestNewsInfo> latestnewslist=new ArrayLis();
ArrayList<AllNewsInfo> allnewslist=new ArrayList<>();// add here
// I try this
allnewslist.addAll(topnewslist); // not add bcoz differnt type of object
allnewslist.addAll(latestnewslist); //not add bcoz differnt type of object
// Note: all object data model value is same.
What is best solution for this??
ArrayList<Object> allnewslist=new ArrayList<>();