雕刻时光

just do it……nothing impossible
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
上一页 1 2 3 4 5 6 7 8 9 10 ··· 50 下一页

2016年6月29日

摘要: 1.java提供的默认list排序方法 主要代码: List<String> list = new ArrayList();list.add("刘媛媛"); list.add("王硕");list.add("李明");list.add("刘迪");list.add("刘布"); //升序Collec 阅读全文

posted @ 2016-06-29 16:37 huhuuu 阅读(1613) 评论(0) 推荐(0) 编辑

2016年6月4日

摘要: Below I present you two different ways to get the current Class: Using Thread Using getClass() The simplest way to get the name of the class where you 阅读全文

posted @ 2016-06-04 16:25 huhuuu 阅读(1417) 评论(0) 推荐(0) 编辑

摘要: 普通情况下,是不会出现“GThread:XThread” 这种情况的,但是在上述高并发,并且共享内存的情况下就可能出现问题! 可以通过这样加锁: 总结:在高并发并且有共享内存的情况下,有几个方法解决并发问题: 1、把共享内存的变量变成线程内部的变量。(有时候是没必要线程共享变量)。 2、在必要线程共 阅读全文

posted @ 2016-06-04 15:52 huhuuu 阅读(1357) 评论(0) 推荐(0) 编辑

2016年5月4日

摘要: 首先是构造函数签名如下: public ThreadPoolExecutor(int corePoolSize,int maximumPoolSize,long keepAliveTime,TimeUnit unit,BlockingQueue<Runnable> workQueue,Rejecte 阅读全文

posted @ 2016-05-04 19:39 huhuuu 阅读(291) 评论(1) 推荐(0) 编辑

2016年4月15日

摘要: 如果输入参数在方法体执行过程中,强制不能被修改,那么参数类型前加final比较安全. final修饰的函数会被编译器优化,优化意味着编译器可能将该方法用内联(inline)方式载入。final修饰变量表示此变量是不可变的,在多线程读写场景来说是线程安全的。 如果输入参数在是类常量,那么参数类型前面加 阅读全文

posted @ 2016-04-15 16:46 huhuuu 阅读(149) 评论(0) 推荐(0) 编辑

2016年4月14日

摘要: 认为会输出什么? 实际只是new了一个对象,数组里面藏着的是指针,指向同一个对象,所以--。 阅读全文

posted @ 2016-04-14 10:28 huhuuu 阅读(263) 评论(0) 推荐(0) 编辑

2016年3月28日

摘要: 转自:http://www.blogjava.net/wilesun/archive/2007/10/30/156999.html Log4j建议只使用四个级别,优先级从高到低分别是ERROR、WARN、INFO、DEBUG #这里定义能显示到的最低级别,若定义到INFO级别,则看不到DEBUG级别 阅读全文

posted @ 2016-03-28 20:56 huhuuu 阅读(255) 评论(0) 推荐(0) 编辑

2016年3月22日

摘要: Character tmp = '/'; if("/".equals(tmp)){ System.out.print("error"); } if("/".equals(tmp.toString())){ System.out.pri... 阅读全文

posted @ 2016-03-22 20:44 huhuuu 阅读(1844) 评论(0) 推荐(0) 编辑

2016年3月3日

摘要: <isNotEqual property="id" compareValue="0" prepend="and">id=#id#</isNotEqual> 这个并不检查id是否为空!!!如果id为空,就会把这个id=?传给数据库进行查询就会有问题!! 可以写成这样 <isNotNull proper 阅读全文

posted @ 2016-03-03 16:03 huhuuu 阅读(270) 评论(0) 推荐(0) 编辑

2016年2月26日

摘要: 现在个人电脑以及服务器都是多核cpu,如何提高多核cpu的利用率,就要用到多线程技术了。 public class TestThread1 { static int i = 0; static class PThread extends Thread { public void run() { fo 阅读全文

posted @ 2016-02-26 20:54 huhuuu 阅读(209) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 7 8 9 10 ··· 50 下一页