java - Generic vs wildcard unknown types -


when recommended do:

public <e> boolean haspropertyx(list<e extends user> alist); 

versus

public boolean haspropertyx(list<? extends user> alist); 

it appear both work well.

without typed return value, difference can think of explicit typing of first way of declaration during method call.

so example using inside typed class c<k extends string>

list<v extends string> input = ...; boolean var = obj.hasproperty<k>(input); 

will raise compiler error. why 1 want so...

nice question if answer both same.


Comments

Popular posts from this blog

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

java - Could not locate OpenAL library -

sorting - opencl Bitonic sort with 64 bits keys -