| Author |
<T extends String>
|
Heba Mahmoud
Ranch Hand
Joined: Apr 26, 2009
Posts: 62
|
|
how this don't cause complair error although the String class is final and can't be exteneded.
as what happens when when say
|
SCJP Pass 85%....
Thousands of candles can be lighted from a single candle, and the life of the candle will not be shortened
|
 |
Deepak Bala
Bartender
Joined: Feb 24, 2006
Posts: 6588
|
|
|
You are not extending string there. The construct simply means the generic type can be anything that extends String. Of course String is final and nothing can extend it.
|
SCJP 6 articles - SCJP 5/6 mock exams - SCJP Mocks - SCJP 5 Mock exam (Word document ) - SCJP 5 Mock exam in Java.Inquisition format
|
 |
Henry Wong
author
Sheriff
Joined: Sep 28, 2004
Posts: 16690
|
|
Also, T can also be String -- and so since String is a final class, it can only be String.
Henry
|
Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
|
 |
 |
|
|
subject: <T extends String>
|
|
|