I want to return two objects from a Java method and was wondering what could be a good way of doing so?
The possible ways I can think of are: return a HashMap<
Use of following Entry object Example :
public Entry methodname(arg)
{
.......
return new AbstractMap.simpleEntry(instanceOfA,instanceOfB);
}