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. 计算机是大…
Learn Java I found out that I and other speakers tended to give the typical audience too many topics too quickly. 我发现我和其他的演讲者往往会在极短的时间内传递太多的主题给听众. I wanted to try to keep everyone up to speed. 我想尽力让每个人都跟上进度 Thinking in Java seminars “Thinking in Java…
Access control ( or implementation hiding) is about "not getting it right the first time." refactoring a primary consideration in object-oriented design is to "separate the thins that change from the thing that stay the same To solve this p…
Two of these safety issues are initialization and cleanup. initialization -> bug cleanup -> running out of resources (most notably, memory) Java adopted the constructor, and in addition has a garbage collector that automoatically releases memory res…
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…
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…
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…