Re: forEach and Casting
- From: Piotr Kobzda <pikob@xxxxxxxxx>
- Date: Sun, 22 Apr 2007 22:36:18 +0200
Jason Cavett wrote:
Now, unfortunately, despite some of the reading I've done, I don't
fully understand the notation. Would you mind explaining it as I
don't like to use a tool I don't understand for fear of misuse.
Well, that's not very hard to understand. There is a single type parameter (declared with type variable E) which serves two roles, 1) constraints returned list elements type to any valid subclass of your base class, and 2) declares a type (using wildcard to allow subclasses) of Class objects being accepted by the method.
Whatever the actual type parameters are, they must match must that declaration, that's all.
HTH,
piotr
.
- References:
- forEach and Casting
- From: Jason Cavett
- Re: forEach and Casting
- From: Tim Hemig
- Re: forEach and Casting
- From: Jason Cavett
- Re: forEach and Casting
- From: Piotr Kobzda
- Re: forEach and Casting
- From: Jason Cavett
- forEach and Casting
- Prev by Date: Re: TCP/IP file transfer and a router
- Next by Date: Re: TCP/IP file transfer and a router
- Previous by thread: Re: forEach and Casting
- Next by thread: Re: forEach and Casting
- Index(es):
Relevant Pages
|