The List collection implements grouping and obtains part of the data in the list

list is the original total collection, newlist is the collection after obtaining a specific area, pageindex indicates the selected specific page number data, ten entries per page

if(pageIndex*10>list.size()){

newlist=list.subList((pageIndex-1)*10, list.size());
}else{
newlist=list.subList((pageIndex-1)*10, pageIndex*10);

}

Note that although newList is a new collection, the data in newList is modified, and the data in list also changes.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325757343&siteId=291194637