容器类库图    List(interface) 次序是List最重要的特点:它保证维护元素特定的顺序.List为Collection添加了许多方法,使得能够向List中间插入与移除元素.(这只推荐LinkedList使用.)一个List可以生成ListIterator,使用它可以从两个方向遍历List,也可以从List中间插入和移除元素. ArrayList* 由数组实现的List.允许对元素进行快速随机访问,但是向List中间插入与移除元素的速度很慢.ListIterator只应该用来由后向…
---恢复内容开始--- Both C++ and Java are hybird languages. A hybird language allow multiple programming styles The reason C++ is hybird is to support backward compatibility with the C langguage (a superset of the C language) The Java language assumes that…
The genesis of the computer revolution was a machine. The genesis of out programming languages thus tends to look like that machine. 计算机革命起源于机器,因此编程语言的产生也始于对机器的模仿 Computers are mind amplification tools and a different kind of expressive medium. 计算机是大…
Runtime type information (RTTI) allow you to discover and use type information while a program is running This take two forms: 1. "traditional" RTTI, which assumes that you have all the types available at compile time, 2. the reflection mechanis…
Immutable Strings Objects of the String class are immutable. If you examine the JDK documentation for the String class, you’ll see that every method in the class that appears to modify a String actually creates and returns a brand new String object c…
The ideal time to catch an error is at compile time, before you even try to run the program. However, not all errors can be detected at compile time. To create a robust system, each component must be robust. By providing a consistent error-reporting…
To solve the general programming problem, you need to create any number of objects, anytime, anywhere. So you can't rely on creating a named reference to hold each one of your objects. Java has several ways to hold objects: 1. the compiler-supported…
The inner class is a valuable feature because it allows you to group classes that logically belong together and to control the visibility of one within the other. However, it's important to understand that inner classes are distinctly different from…
Interfaces and abstract classes provide more structured way to separate interface from implementation. the abstract class, which is a kind of midway step between an ordinary class and an interface. Abstract classes and methods abstract void f(); A cl…
Polymorphism is the third essential feature of an object-oriented programming language,after data abastraction and inheritance. It provides another dimension of separation of interface from implementation, to decouple what from how. Polymorphism allo…