Question: In Java: How would you match together random person objects from an ArrayList to make a random group of Pairs and add them to an

 In Java: How would you match together random person objects from

In Java: How would you match together random person objects from an ArrayList to make a random group of Pairs and add them to an ArrayList so that each Person has a match and the same person doesn't have the multiple have multiple matches? Example Rob can not be person1 in pair more than once and also can not be person2 in pair more than wants, but has to be both a person1 and person2 just not in the same pair.

public class Person private String name; private String age public class Pair private Person personl; private Person person2 Pair (Person person1 Person person2) More Codex /*This is where the help is need*/ public class Match private ArrayList pairs private ArrayList people; More Codex/

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!