SCJA 96%
SCJP 6 88%
skipping SCJD to work on passing SCWCD
SCJA 96%
SCJP 6 88%
skipping SCJD to work on passing SCWCD
If ? extends -->cannot add anything to the list usind add method
'? super E' specify upper boundary.
I mean we can add sub types of E or E itself. My statement is contradicting with yours
Originally posted by Rekha Srinath:
? extends - As I said earlier, you cannot add anything to a list declared in this way.
Originally posted by Rekha Srinath:
? super - You can add elements, but only of types equal to or more than (higher up the inheritance tree) what follows the super keyword.
SCJP 5
List<? super Animal> an = new ArrayList<species>();
an.add(new species());
SCJP 5
Orginally posted by Rekha Srinath
The "super" concept is applicable to the generic type of the list being assigned.
But, the add() method will accept only subtypes or itself of what is in the declaration.
We've gotta get close enough to that helmet to pull the choke on it's engine and flood his mind! Or, we could just read this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
|