TIJ——Chapter Nine:Interfaces】的更多相关文章

A class containing abstract methods is called an abstract class. If a class Contains one of more abstract methods, the class itself must be qualified(限定,修饰) as a abstract. If you inherit from an abstract class you want to make objects of the new type…
Java Provides a number of ways to hold objects: An array associates numerical indexes to objects. It holds objects of a known type so that you don't have to cast the result when you're looking up an object. It can be multidimensional, and it can hold…
If we spoke a different language, we would perceive a somewhat different world. Ludwig Wittgenstein(1889-1951) You manipulate objects with references Although you treat everything as an object, the identifier you manipulate is actually "reference&quo…
///:~容我对这个系列美其名曰"读书笔记",其实shi在练习英文哈:-) Introduction to Objects Object-oriented programming(OOP) is part of this movement toward using the computer as an expressive medium. This chapter will introduce you to the basic concepts of OOP, including an…
Runtime type information(RTTI) allows you to discover and use type information while a program is running. All classes are loaded into the JVM dynamically, upon the first use of a class. This happens when the program makes the first reference to a st…
Exception guidelines Use exceptions to: Handle problems at the appropriate level.(Avoid catching exceptions unless you know what to do with them.) Fix the problem and call the method that caused the exception again. Patch things up and continue witho…
先提纲挈领地来个总结: 内部类(Inner Class)有四种: member inner class,即成员内部类.可以访问外部类所有方法与成员变量.生成成员内部类对象的方法:OuterClass.InnerClass inner = new OuterClass().new InnerClass(); static inner class,即静态内部类.只能访问外部类的静态方法与静态成员变量,生成静态内部类对象的方法:OuterClass.InnerClass inner = new Out…
The twist |_Method-call binding Connecting a method call to a method body is called binding. When binding is performed before the program is run(by the compiler and linker, if there is one), it's called early binding. You might not hava heard the ter…
Reusing Classes 有两种常用方式实现类的重用,组件(在新类中创建存在类的对象)和继承. Composition syntax Every non-primitive object has a toString() method, and it’s called in special situations when the compiler wants a String but it has an object. Inheritance syntax You’re always do…
Method overloading |_Distinguishing overloaded methods If the methods hava the same name, how can Java know which method you mean? There's a simple rule : Each overloaded method must take a unique list of argument types. |_Overloading with primitives…