Java Puzzlers
czjuttsw
Learning, staying up to date, and working on the latest and greatest in languages and APIs is what keeps me excited.
展开
-
初级问题
看看下面的代码,打印的会是什么呢? public class Elementary { public static void main(String[] args) { System.out.println(12345 + 5432l); } } 相信很多人都会说是66666,其实真正的答案是17777。 问题的根源在于数字的1和字母的l很相似,如果不是特别仔细的观察,是很容原创 2013-02-26 10:37:19 · 1244 阅读 · 2 评论 -
在循环中
public class InTheLoop { public static final int END = Integer.MAX_VALUE; public static final int BEGIN = END - 100; public static void main(String[] args) { int count = 0; for(int i= BEGIN ;原创 2013-02-26 23:21:59 · 1093 阅读 · 0 评论