Java Knowledge series 5】的更多相关文章

JVM & Bytecode Has-a or Is-a relationship(inheritance or composition) 如果想利用新类内部一个现有类的特性,而不想使用它的接口,通常应选择合成.也就是说,我们可嵌入一个对象,使自己能用它实现新类的特性.但新类的用户会看到我们已定义的接口,而不是来自嵌入对象的接口.考虑到这种效果,我们需在新类里嵌入现有类的private对象.有些时候,我们想让类用户直接访问新类的合成.也就是说,需要将成员对象的属性变为public.成员对象会将自…
Pepole who make a greate contribution on common libaraies deserve our respect. Component(Widget) / STL / Container(Collection) 合成不会强迫我们的程序设计进入继承的分级结构中has-a relationship.同时,合成显得更加灵活,因为可以动态选择一种类型(以及行为),而继承要求在编译期间准确地知道一种类型. Java的工具(实用程序)库提供了一些“集合类”(亦称作“…
Interface from user, not from implementor.(DIP) Interface-Oriented Programming. Interface or Abstract function or Abstract class Java专门提供了一种机制,名为“抽象方法”(same as abstraction).它属于一种不完整的方法,只含有一个声明declaration,没有方法主体 body of definition.下面是抽象方法声明时采用的语法:abst…
JVM & Bytecode Abstract & Object Object in Java (1) 所有东西都是对象object.可将对象想象成一种新型变量:它保存着数据,但可要求它对自身进行操作self-operation(this pointer is always as parameter pssing to function called on object).理论上讲,可从要解决的问题身上提出所有概念性的组件,然后在程序中将其表达为一个对象. (2) 程序是一大堆对象的组合c…
JVM Analysis & Design The object-oriented paradigm is a new and different way of thingking about programming. Most of the analysis and design methodologies are intended to sovle the largest of problems. Remember that most projects don’t fit intot hat…
Programming language evolves always along with Compiler's evolvement JVM as Additional Indirection Introduction to Object Everthing is an object. Think of an object as a fancy variable; it stores data, but you can “make requests” to that object, aski…
1. javaee(Web) and Android 2. how to use eclipse and break point debuging in eclipse, as to java web, use myeclipse: shortcut keys:  ,do not use Chinese or space in workspace path, configure JRE default, as jdk already has jre, we just configure with…
1. cli (command line interface) and gui (graphic user interface) use javahome path, search classpath 2. java editions: j2ee(java 2 enterprise edition), j2se(java 2 standard edition), j2me(java 2 micro edition), after java5.0, rename to javaee, javase…
Programming language evolves always along with Compiler's evolvement. 1. The C++ Object Model: Stroustrup's original (and still prevailing) C++ Object Model is derived from the simple object model by optimizing for space and access time. Non-static d…
Thank to the pepole who devote theirself to the common libs. STL(http://www.cplusplus.com/reference/) 旧的C++头文件名如<iostream.h>将会继续被支持,尽管它们不在官方标准official standard中.这些头文件的内容不在名字空间std中.No _STDBEGIN (namespaces std {}and _STDEND. 新的C++头文件如<iostream>…