Tag Archives: java

Java程序员必看电影:Java 4-ever

.net算个毛!

有关Runtime.addShutdownHook(Thread)

今天在JDK的javadoc里瞎转的时候无意间发现这么一个有趣的回调方法: addShutdownHook public void <b>addShutdownHook</b>(<a href="http://download.oracle.com/javase/6/docs/api/java/lang/Thread.html" onclick="javascript:_gaq.push(['_trackEvent','outbound-article','http://download.oracle.com']);" title="class in java.lang">Thread</a> hook) public void <b>addShutdownHook</b>(<a href=”http://download.oracle.com/javase/6/docs/api/java/lang/Thread.html” onclick=”javascript:_gaq.push(['_trackEvent','outbound-article','http://download.oracle.com']);” title=”class in java.lang”>Thread</a> hook) Registers a new virtual-machine shutdown hook. The Java virtual machine shuts down in response to two kinds of events: The program exits normally, when the last non-daemon thread exits or when the exit (equivalently, System.exit) read more »

植树节,写棵二叉树庆祝一下

今天下午看见一条推 RT: @rtmeme: RT @foxzzz RT @junyu: 看到 @windbreaker 老师在Buzz说:今天是植树节,写一棵二叉树庆祝之 (via @yangfannet) 于是兴起,花了半个多小时写了棵自认为(从工程而非算法上)比较牛逼的排序二叉树 package com.jayxu; import java.util.Iterator; import java.util.Random; import java.util.Stack; /** * * @author ijay */ public class BinaryTree implements Iterable { private static final char[] FIRST_CHAR = {‘B’, ‘C’, ‘K’, ‘F’, ‘D’, ‘G’}; private static final char[] FOLLOWING_CHAR = {‘a’, ‘k’, ‘l’, ‘p’, read more »

Snow Leopard下的JDK链接有问题

今天在SL下build JRex,在执行ant make的时候总是出现以下错误: compile: [javac] Compiling 86 source files to /Users/ijay/Projects/mozilla/embedding/JRex/classes [javac] /Users/ijay/Projects/mozilla/embedding/JRex/src/java/netscape/javascript/JSObject.java:38: ?????? sun.plugin.javascript ?????? [javac] import sun.plugin.javascript.JSContext; [javac] ^ [javac] /Users/ijay/Projects/mozilla/embedding/JRex/src/java/netscape/javascript/JSObject.java:172: ?????? sun.plugin.javascript ?????? [javac] if (c instanceof sun.plugin.javascript.JSContext) [javac] ^ [javac] /Users/ijay/Projects/mozilla/embedding/JRex/src/java/netscape/javascript/JSObject.java:174: ?Ҳ??????? [javac] ???ţ? ?? JSContext [javac] λ?ã? ?? netscape.javascript.JSObject [javac] JSContext j = (JSContext) c; [javac] ^ [javac] /Users/ijay/Projects/mozilla/embedding/JRex/src/java/netscape/javascript/JSObject.java:174: ?Ҳ??????? read more »

java.net论坛被黑(有图有真相)

从今天中午开始java.net论坛被黑,所有标题、内容变成了“RED EYE OWNZ – by Z4i0n”,一直到现在都没恢复,Sun在干啥呢?

Apache给EJB 3.1(JSR #318)投了否决票

刚才在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 Apache Software Foundation’s vote is based on the point of view that this spec lead – Sun – is in violation of the JSPA http://www.apache.org/jcp/sunopenletter.html and therefore shouldn’t be allowed to lead other JSRs until the above matter is read more »

10 things all JAVA developers should know [zz]

原文在这里 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) once said that it was not about the hardware but the software which will be the future. A read more »

BlockingQueue与InterruptedException

感谢Blader同学的抛砖 首先,这段代码会编译成功吗,运行起来会有异常吗,他会打印什么? import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue;   public class Foo {    public static void main(String[] args) throws InterruptedException {        BlockingQueue q = new LinkedBlockingQueue();        q.put(1);        Thread.currentThread().interrupt();        System.out.println(q.take());    } } import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; public class Foo { public static void main(String[] read more »

Which GlassFish version is right for me? [zz]

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 a quick list of features and reasons to use one more than the other. • GlassFish v2.1: current JavaEE read more »

Sun 卖了……

刚刚得到的消息,Oracle收购了Sun,9.5刀一股,一共74亿 这里是Oracle的官方声明 这里是Sun的声明 这里是一篇国外新闻 接下来的时间就看Sun和Oracle的重复部分如何整合(或者舍弃)了 MySQL VS Oracle DB GlassFish VS WebLogic(不知道之前为什么买了BEA) JDK VS JRockit JDeveloper VS Netbeans 红色 VS 蓝色 关注中……

无觅相关文章插件,快速提升流量