将 int 类型转换成 String 类型:
方法 1 (直截了当,首选):
|
|
-》这个方法是Integer类中的静态方法,直接将int数据转换成String类型。(20090514追加)
方法 2 (绕了一圈,备选):
先转换成 Integer ,再转换成 String
|
|
-》这两个方法也是Integer类中的方法,不如直接使用方法1来得干脆。(20090514追加)
方法3(20090514追加):
使用String类中的valueOf方法,如同方法1,也可以直接将int数据转换成String类型。
static String | valueOf (int i) Returns the string representation of the int argument. |
List 的使用:
List list = new ArrayList()
对外暴露的是 List 接口,内部使用的是具体的实现类。
-》这也算是小小的面向接口编程的例子吧(20090514追加)。
一個Eclipse插件implementors——用來從接口快速定位到其實現的插件。
-》在NBS项目中,这个插件得到了广泛应用,快速定位,提高效率,很不错。
官网的英文介绍:The Implementors plugins add the possibility to jump to the implementation of of an interface. Alternatively, you can jump to the interface of an implementation.
中文解释:这个Implementors插件添加了从接口跳转到实现类的能力,二选一,你也能够从实现类跳转到接口。
(20090514追加)