Base of Java
oldnewhand
这个作者很懒,什么都没留下…
展开
-
重温 Thinking in Java - 1 Everything is an object
Everything in Java is an object. You manipulate objects with references. Although you treat everything as an object, the identifier you manipulate is actually a “reference” to an object. That...2009-07-26 11:23:46 · 189 阅读 · 0 评论 -
重温 Thinking in Java - 2 Method Overloading
Distinguishing overloaded methods If the methods have the same name, how can Java know which method you mean? There's a simple rule: Each overload method must take a unique list of argument types. ...2009-07-26 11:24:19 · 106 阅读 · 0 评论 -
重温 Thinking in Java - 3 The this keyword
class Banana { void peel(int i){ //do something } } public class BananaPeel { public static void main(String[] args){ Banana a = new Banana(), b = new Banana(); a.peel(1...2009-07-31 11:12:11 · 108 阅读 · 0 评论 -
重温 Thinking in Java 4 - Type information
import java.util.List; import java.util.Arrays; abstract class Shape { void draw() { System.out.println(this + ".draw()"); } abstract public String toString(); } class Circle...2009-08-12 23:35:05 · 103 阅读 · 0 评论 -
重温 Thinking in Java 5 - The Class object
To understand how RTTI works in Java, you must first know how type information is represented at run time. This is accomplished through a special kind of object called the Class object, which contains...2009-08-12 23:38:37 · 139 阅读 · 0 评论 -
重温 Thinking in Java 6 - Registered factories
Registered factories A problem with generating objects of the Pets hiearachy is the fact that every time you add a new type of Pet to the hierarchy you must remember to add it to the entries i...2009-08-12 23:39:37 · 117 阅读 · 0 评论 -
重温 Thinking in Java 7 - instanceof vs Class equivalence
instanceof vs Class equivalence /* When you are querying for type information, there's an important different between either form of instanceof(that is, instanceof or isInstance(), which p...2009-08-13 00:02:07 · 143 阅读 · 0 评论 -
重温 Thinking in Java 8 - Reflection
If you don't know the precise type of an object, RTTI will tell you. However, there's a limitation: The type must be known at compile time in order for yo uto detect it using RTTI and to do something ...2009-08-13 15:47:08 · 127 阅读 · 0 评论 -
重温 Thinking in Java 9 - Dynamic proxies
Proxy is one of the basic design patterns. It is an object that you insert in place of the "real" object in order to provide additional or different operations-these usually involve communication with...2009-08-13 15:47:55 · 110 阅读 · 0 评论