public List<Bars>pageListTwo(int currentPage, int showRows)
Connection con = null
PreparedStatement ps = null
ResultSet rs = null
ArrayList<Bars>resultList = new ArrayList<Bars>()
try
{
trap方法返回的是前一次调用时传入的block,实际上是一个Proc对象。而Proc对象拥有call方法,调用该方法就会执行block的代码段。
因此,例子中第二次调用trap时,返回的是 proc { puts 'first signal handler' },并赋给了old_handler变量。
在捕获中断时,就执行:
old_handler.call # 这里就是调用了Proc对象的call方法,执行了第一次调用trap时传入的block
puts 'second signal handler'
exit