Code Snippet: A common duplet class
Java doesn’t allow multi-value method returning. To return 2 values for a method, you can create a "pair" object which contains two values. /** * a pair of objects. like other containers, you’d rather return an empty * container than a null one * * * */ public class MyDuplet<L,R> { public L left; public …