本月博客排行
-
第1名
wy_19921005 -
第2名
mft8899 -
第3名
java-007 - Anmin
年度博客排行
-
第1名
龙儿筝 -
第2名
宏天软件 -
第3名
benladeng5225 - wy_19921005
- vipbooks
- 青否云后端云
- kaizi1992
- e_e
- tanling8334
- sam123456gz
- arpenker
- zysnba
- fantaxy025025
- xiangjie88
- wallimn
- lemonhandsome
- jh108020
- ganxueyun
- Xeden
- xyuma
- zhanjia
- wangchen.ily
- johnsmith9th
- zxq_2017
- forestqqqq
- jbosscn
- daizj
- ajinn
- xpenxpen
- 喧嚣求静
- kingwell.leng
- lchb139128
- kristy_yy
- jveqi
- javashop
- lzyfn123
- sunj
- yeluowuhen
- lerf
- silverend
- chenqisdfx
- xiaoxinye
- flashsing123
- bosschen
- lyndon.lin
- zhangjijun
- sunnylocus
- lyj86
- paulwong
- sgqt
最新文章列表
Item 25: Prefer lists to arrays
1. Arrays are covariant which means simply that if Sub is a subtype of Super, then the array type Sub[] is a subtype of Super[]. Generics, by contrast, are invariant: for any two distinct types Type1 ...
关于java泛型的小测试(wildcard,erasure,covariant,raw type)
java的泛型机制让人头大,很难搞,我也生晚,见识也浅,权且抛砖引玉,望各位看官多多指点!
从测试中暂时得到的几个小结论:
原生类型与<?>并不相同,从测试中的warning可以看到这一点;
其一,原生类型会擦除其所有实例成员的泛型参数;
其二,<?>代表我要使用泛型,而不是原生类型;
其三,<Object ...