close
Warning:
Can't synchronize with repository "(default)" (Unsupported version control system "svn": liblber-2.4.so.2: failed to map segment from shared object: Cannot allocate memory). Look in the Trac log for more information.
- Timestamp:
-
Jul 10, 2008, 4:31:22 PM (17 years ago)
- Author:
-
waue
- Comment:
-
--
Legend:
- Unmodified
- Added
- Removed
- Modified
-
|
v2
|
v3
|
|
| | 1 | [[PageLayout]] |
| 1 | 2 | 當您定義類別時,發現到好幾個類別的邏輯其實都相同,就只是當中所涉及的型態不一樣時,使用複製、貼上、取代的功能來撰寫程式只是讓您增加不必要的檔案管理困擾。 |
| 2 | 3 | |
| … |
… |
|
| 419 | 420 | [[BR]] |
| 420 | 421 | |
| 421 | | 事實上,GenericFoo<?> immutableFoo相當於GenericFoo immutableFoo。[[BR]] |
| | 422 | 事實上,!GenericFoo<?> immutableFoo相當於!GenericFoo immutableFoo。[[BR]] |
| 422 | 423 | [[BR]] |
| 423 | 424 | |
| … |
… |
|
| 427 | 428 | [[BR]] |
| 428 | 429 | |
| 429 | | '''GenericFoo<? super !StringBuilder> foo;'''[[BR]] |
| | 430 | '''!GenericFoo<? super !StringBuilder> foo;'''[[BR]] |
| 430 | 431 | |
| 431 | 432 | |
| … |
… |
|
| 435 | 436 | 您可以擴充一個泛型類別,保留其型態持有者,並新增自己的型態持有者,例如先寫一個父類別: |
| 436 | 437 | |
| 437 | | * GenericFoo.java |
| | 438 | * !GenericFoo.java |
| 438 | 439 | {{{ |
| 439 | 440 | #!java |
| … |
… |
|
| 496 | 497 | 實作時如下,保留所有的型態持有者: |
| 497 | 498 | |
| 498 | | * GenericFoo.java |
| | 499 | * !GenericFoo.java |
| 499 | 500 | {{{ |
| 500 | 501 | #!java |