As we know if we want to overload an existing method, we should somehow change the number of parameters or the type of parameter. Here is my dilemma,I want to use overload with set type binding different subtypes
private boolean usedOverlap(Set<Variable> useVars, Set<Value> list) {
// TODO Auto-generated method stub
for(Variable use:useVars){
if(list.contains(use.getValue()))
return true;
}
return false;
}
private boolean usedOverlap(Set<Value>vaset_A,Set<Value>vaset_B){
Set<Value>intersection = new HashSet<Value>(vaset_A);
intersection.retainAll(vaset_B);
if(intersection.isEmpty())
return false;
else
return true;
}
There goes the problem how can I use overload in this case above. For the first parameter In the first method : Set second method: Set
Set)