Question: I'm learning java and I have a problem, I'm working on library system and can't figure out how to send information about created user to list(hashMap) of users... 

On the picture below is my code, in red circle admin call method to create librarian. Problem is I can't figure out how to send information about this to blue circle to add this new librarian to list of users... I thought I would move hashMap activeUsers to class admin but i need librarians to create customers as well so... 

[![](https://i.stack.imgur.com/xRSyS.png)](https://i.stack.imgur.com/xRSyS.png)

any idea please?

Answer: 
You can either make the variables public, so you can access to them from all the other classes, or you could write methods that return their value that you can call from any other class. You can find more information [here](https://www.google.it/url?sa=t&source=web&rct=j&url=https://medium.com/%40peterekeneeze/passing-data-between-activities-2d0ef122f19d&ved=2ahUKEwiW7KfZ4YnmAhVBCewKHZChDwQQFjAKegQICRAB&usg=AOvVaw21onVbE8fHWEXXagA0Sz0R) too, if you need.
You can try addUser(l.name, l.psw) in createLibrarian() function. Thanks