JAVA
The Trainer class
A trainer is also given a name upon creation. Otherwise, he has room to carry six pocket monsters at a time. Store them in a suitable data structure.
The pocket monsters must be added to the trainer's inventory.
The receive() method is passed a pocket monster and adds it to the previously selected data structure selected before. Make sure that no more than six pocket monsters can be added at the same time.
Each trainer must be able to send his pocket monsters into battle.
For this, write a send() method that randomly returns one of the
pocket monsters. Overload this method so that it is also possible
to choose the pocket monster based on its place in the trainer's
inventory. Note: For both methods, be careful not to return an
incapacitated pocket monster back.
Override the toString() method so that it returns the profile of
all the trainer's pocket monsters.
PS:
PLEASE TEST THE ANSWER BEFOR POSTING IT