Information Retrieval Blog » 泛型
http://blog.zye.me
ANTI-GFWSun, 29 Aug 2010 03:59:54 +0000http://wordpress.org/?v=2.9.1enhourly1Java泛型中通配符使用
http://blog.zye.me/2010/02/50190.html
http://blog.zye.me/2010/02/50190.html#commentsFri, 19 Feb 2010 16:10:26 +0000jeffyehttp://blog.so8848.com/?p=50190泛型是一种表示类或方法行为对于未知类型的类型约束的方法,比如 “不管这个方法的参数 x 和 y 是哪种类型,它们必须是相同的类型”,“必须为这些方法提供同一类型的参数” 或者 “foo() 的返回值和bar() 的参数是同一类型的”。虽然 String 是 Object 的子类,但是 List<String> 和 List<Object> 之间并没有什么关系——List<String> 不是 List<Object> 的子类或者子类型。
Wildcards
Consider the problem of writing a routine that prints out all the elements in a collection. Here’s how you might write it in an older version of the language (i.e., a pre-5.0 release):
void printCollection(Collection c) { [...]]]>http://blog.zye.me/2010/02/50190.html/feed0Java1.5泛型指南中文版(Java1.5 Generic Tutorial, zhuan)
http://blog.zye.me/2008/02/11788.html
http://blog.zye.me/2008/02/11788.html#commentsFri, 29 Feb 2008 03:17:27 +0000jeffyehttp://www.5yiso.cn/2008/02/11788.htmlhttp://blog.zye.me/2008/02/11788.html/feed0