阅读本文大概需要 5 分钟。
一、分支预测
https://stackoverflow.com/questions/11227809/why-is-it-faster-to-process-a-sorted-array-than-an-unsorted-array
<span style="max-width: 100%; font-family: 'Helvetica Neue', Helvetica, 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif; box-sizing: border-box !important; overflow-wrap: break-word !important;">为什么处理一个排序数组要比非排序数组快的多</span>
。http://stackoverflow.com/questions/11227809/why-is-it-faster-to-process-a-sorted-array-than-an-unsorted-array/11227902#11227902
二、Java中的安全
http://stackoverflow.com/questions/8881291/why-is-char-preferred-over-string-for-passwords-in-java
三、异常
http://blog.takipi.com/the-top-10-exceptions-types-in-production-java-applications-based-on-1b-events/
四、为什么这段代码使用随机字符串打印出了”hello world”
http://stackoverflow.com/questions/15182496/why-does-this-code-using-random-strings-print-hello-world
Random ran = new Random(i);
StringBuilder sb = new StringBuilder();
while (true){
int k = ran.nextInt(27);
if (k == 0)
break;
sb.append((char)(‘`’ + k));
}
return sb.toString();
}
五、为什么两个时间戳相减(in 1927)得出一个奇怪的结果?
http://stackoverflow.com/questions/6841333/why-is-subtracting-these-two-times-in-1927-giving-a-strange-result
SimpleDateFormat sf = new SimpleDateFormat(“yyyy-MM-dd HH:mm:ss”);
String str3 = “1927-12-31 23:54:07”;
String str4 = “1927-12-31 23:54:08”;
Date sDt3 = sf.parse(str3);
Date sDt4 = sf.parse(str4);
long ld3 = sDt3.getTime() /1000;
long ld4 = sDt4.getTime() /1000;
System.out.println(ld4-ld3);
}
http://stackoverflow.com/a/6841479/5982245
六、无法被捕获的ChuckNorrisException
http://stackoverflow.com/questions/13883166/uncatchable-chucknorrisexception
http://stackoverflow.com/a/13883510/5982245
七、哈希表
http://zeroturnaround.com/wp-content/uploads/2016/04/Java-Collections-cheat-sheet.png
八、总结
推荐阅读:
HTTP/3 来了 !HTTP/2 还没怎么用起来呢,先一起扫个盲吧!
微信扫描二维码,关注我的公众号
朕已阅
文章收集整理于网络,请勿商用,仅供个人学习使用,如有侵权,请联系作者删除,如若转载,请注明出处:http://www.cxyroad.com/1643.html