Winston Gutkowski wrote:
R. Jain wrote:I'm afraid Jesper, but I've to disagree with you on this. You can add BigCats or any of it's subtypes to such lists. Right?
And, as he says, since the compiler doesn't know what that type is; it can't allow you to add anything.
Jesper de Jong wrote:The same with List<? super bigcats>. The compiler doesn't know what the exact type is of the elements in the list - it only knows that it's something that is a superclass of bigcats. You can't add anything to that list, for exactly the same reason as above.
Raymond Gillespie wrote:They are String objects.
jegadees waran wrote:I knew the values should be of type string for the comparable to Work
If execution of the try block completes abruptly because of a throw of a value V, then there is a choice:
If the run-time type of V is not assignment compatible with a catchable exception class of any catch clause of the try statement, then the finally block is executed. Then there is a choice:
If the finally block completes normally, then the try statement completes abruptly because of a throw of the value V. If the finally block completes abruptly for reason S, then the try statement completes abruptly for reason S (and the throw of value V is discarded and forgotten).
It can be seen, then, that a return statement always completes abruptly.