摘要:This is an old yet still popular question. There are multiple reasons that String is designed to be immutable in Java. A good answer depends on good understanding of memory, synchronization, data structures, etc. In the following, I will summarize some answers.
阅读全文
摘要:自己学完Java Collections框架之后,其中的一个较大的收获就是接口对于层次的重要性。Java Collections的最终实现至少有几十个,其中很多都有非常相似的功能(method), 如果各个实现中部分代码都是相同的,就没有做到代码reused。想想吧,开发JDK的那些大牛们,怎么可能会犯这么低级的错误呢,说远了,回到正题上:接口。
阅读全文
摘要:Java Collections 框架主要包含interfaces, implementations, aggregate operations and algorithms四个部分...........
阅读全文
摘要:Computer users take it for granted that their systems can do more than one thing at a time. They assume that they can continue to work in a word processor, while other applications download files, manage the print queue, and stream audio. Even a single application is often expected to do more than one thing at a time. For example, that streaming audio application must simultaneously read the digital audio off the network, decompress it, manage playback, and update its display. Even the word proc
阅读全文