public class CalculationPage { private Boolean showStartPagerDot; private Boolean showEndPagerDot; private int pageIndex; private int pageSise; private int totalPages; private int dataTotal; private List<Long> pageNumbers; private int prevPage; priv
喃都不说了,贴代码,意思都在代码里面了 Page.java //分页类.定义分页字段信息,供前台页面使用 package com.core.common; import java.util.List; public class Page<T> { private int pageIndex;//当前页 private int pageSize;//每页条数 private int totalCount;//符合查询条件总条数 private List<T> pageData;//符
1. 尝试通过if-else来解决异常问题: Eg: public class Test2 { public static void main(String[] args) { Scanner in = new Scanner(System.in); … System.out.print("请输入除数:"); int num2 = 0; if (in.ha
一.各种常见的异常 在上一节中程序如果你注意留意,程序抛出的异常是:java.lang.ArithmeticException.这个异常是在lang包中已经定义的.在lang包中还定义了一些我们非常常见的异常,如下表: 上面这些异常要求都能记住,程序抛出了异常后,你要知道程序发生了是什么问题.我们可以举个例子说明一下.代码如下: public static void main(String[] args) { Cal cal=null;//没有new对象 try{ int result=cal.
Chapter 9 Exceptions Item 57: Use exceptions only for exceptional conditions 这条item的意思就是,千万不要用exception来控制control flow的终止,比如: // Horrible abuse of exceptions. Don't ever do this! try { int i = 0; while(true) range[i++].climb(); } catch(ArrayIndexOutO