有关Runtime.addShutdownHook(Thread)
今天在JDK的javadoc里瞎转的时候无意间发现这么一个有趣的回调方法:addShutdownHook public void addShutdownHook(Thread hook)Registers a new virtual-machine shutdown hook. The Java virtual machine shuts down in response to [more...]
今天在JDK的javadoc里瞎转的时候无意间发现这么一个有趣的回调方法:addShutdownHook public void addShutdownHook(Thread hook)Registers a new virtual-machine shutdown hook. The Java virtual machine shuts down in response to [more...]
今天下午看见一条推RT: @rtmeme: RT @foxzzz RT @junyu: 看到 @windbreaker 老师在Buzz说:今天是植树节,写一棵二叉树庆祝之 (via @yangfannet)于是兴起,花了半个多小时写了棵自认为(从工程而非算法上)比较牛逼的排序二叉树package com.jayxu;import [more...]
今天在SL下build JRex,在执行ant make的时候总是出现以下错误:compile: [javac] Compiling 86 source files to /Users/ijay/Projects/mozilla/embedding/JRex/classes [javac] [more...]
从今天中午开始java.net论坛被黑,所有标题、内容变成了“RED EYE OWNZ - by Z4i0n”,一直到现在都没恢复,Sun在干啥呢?
刚才在Glassfish的Google Group上收到有关Apache在EJB 3.1 JSR表决上投了否决票的消息。过去看了一下,发现只有Apache投了否决票,Eclipse、Spring弃权,而且Apache的理由相当牛逼:On 2009-11-30 Apache Software Foundation voted No with the following comment: The [more...]
原文在这里Since JAVA (I know it's not an acronym, but it stands out like that) was officially introduced in 1995, it has changed the way most of us look at the Operating System. Bill Gate (how ironic) [more...]
感谢Blader同学的抛砖首先,这段代码会编译成功吗,运行起来会有异常吗,他会打印什么?import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue;public class Foo { public static void main(String[] [more...]
GlassFish has several versions that you may have heard of. Each one attempts to address different needs. I've had several people in the last couple of weeks ask me which one they should use, so here's [more...]
对于value为集合的map,一般直觉上我们可能会选用下面的方式遍历map中所有collection的所有对象:for(K key:map.keySet()){ for(V value:map.get(key)){ // do sth. } }实际上,这种方式在第二行上会因为对哈希表的查询浪费效率,正确的做法应该这样:for(List [more...]