Advertisement
Guest User

Untitled

a guest
Feb 18th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. package project;
  2.  
  3.  
  4. import java.util.HashMap;
  5.  
  6. public class User {
  7. private static HashMap<String, String> userList = new HashMap<String, String>();
  8.  
  9. private String userName;
  10. private String password;
  11. private String name;
  12.  
  13. public User (String inputtedUserName, String inputtedPassword, String inputtedName) {
  14. this.userName = inputtedUserName;
  15. this.password = inputtedPassword;
  16. this.name = inputtedName;
  17. userList.put(userName, password);
  18. }
  19.  
  20. public String getUserName (User user) {
  21. return user.userName;
  22. }
  23.  
  24. public String getPassword (User user) {
  25. return user.password;
  26. }
  27.  
  28. public String getName (User user) {
  29. return user.name;
  30. }
  31.  
  32. public static boolean find(String uName, String pass) {
  33. if (userList.get(uName).equals(pass)) {
  34. return true;
  35. }
  36. return false;
  37. }
  38.  
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement