why generics not suitable java

i have Set:

Set potentialOwners = new HashSet();

then i take:

Set bpmPotentialOwners = taskDetail.getPotentialOwners();

and then:

potentialOwners.addAll(bpmPotentialOwners);

it's ok!

but if i write:

Set potentialOwners = new HashSet();

Set bpmPotentialOwners = taskDetail.getPotentialOwners();

potentialOwners.addAll(bpmPotentialOwners);

or:

Set potentialOwners = new HashSet();

Set bpmPotentialOwners = taskDetail.getPotentialOwners();//here bad type, not compile

potentialOwners.addAll(bpmPotentialOwners);

it's not compile, why?...

Read More »

By: StackOverFlow - Friday, 9 November

Related Posts