摘要:
业务场景:需要实现一个支持并发的计数功能 1、计数功能的基本实现是: public class Increment{ private int count = 0; public void add(){ count++; } } 2、以上实现在并发环境下是不安全的,故修改方案1是加锁synchroni 阅读全文
摘要:
问题描述: MYSQL采用limit进行翻页查询时,搭配order by ,在翻到第二页的时候可能会出现第一页的数据, 示例sql如下: select a,b from c where d = 'xxx' order by e desc limit 5,5 使用上述sql查询的时候,可能出现和lim 阅读全文
摘要:
public class printoutFile { public static void main(String[] args) { printFile(new File("D:\\test"),1); } public static void printFile(File file,int s 阅读全文