码迷,mamicode.com
首页 > 编程语言 > 详细

Java分页算法dome

时间:2018-06-20 23:56:44      阅读:183      评论:0      收藏:0      [点我收藏+]

标签:sys   static   mini   算法   nis   public   ges   int   size   

/**
* 分页算法
* @author Administrator
*
*/
public class FenYe {
public static void main(String[] args) {
int totalRows =120;//总条数据
int pageSize =20;//每页条数
int totalPage;//总页数
if((totalRows%pageSize)==0){
totalPage = totalRows/pageSize;
}else{
totalPage = totalRows/pageSize+1;
}
System.out.println("总页数:"+totalPage);
}
}

Java分页算法dome

标签:sys   static   mini   算法   nis   public   ges   int   size   

原文地址:https://www.cnblogs.com/feixianglove88/p/9206515.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!