Advertisement
Guest User

Untitled

a guest
Nov 15th, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1.  
  2. public class User {
  3.  
  4. protected static final String String1 = "fdgf";
  5. protected String username = "phantomblade";
  6. protected String password = "shadows";
  7. protected static String addMoney = "AddMoney";
  8. protected static String pullingMoney = "PullingMoney";
  9. protected static String checkingAccount = "CheckingAccount";
  10.  
  11. private double account;
  12.  
  13. protected User(String username, String password) {
  14. this.password = password;
  15. this.username = username;
  16. this.account = 1000;
  17. }
  18.  
  19. protected User() {
  20.  
  21. }
  22.  
  23. protected String getPassword() {
  24. return password;
  25. }
  26.  
  27. protected String getUsername() {
  28. return username;
  29. }
  30.  
  31. protected String getAddMoney() {
  32. return addMoney;
  33. }
  34.  
  35. protected String getPullingMoney() {
  36. return pullingMoney;
  37. }
  38.  
  39. protected String getCheckingAccount() {
  40. return checkingAccount;
  41. }
  42.  
  43. protected String LoggIn(String User) {
  44. User obj = new User("phantomblade648", "magicalRod");
  45. if (obj.LoggIn(username).equals(username)) {
  46. System.out.println("penties");
  47. }
  48. return username;
  49. }
  50.  
  51. protected double addMoney(int t) {
  52. double account=1000;
  53. account = account + t;
  54. return account;
  55. }
  56.  
  57. protected double pullingMoney(int v) {
  58. double account=1000;
  59. account = account - v;
  60. return account;
  61. }
  62.  
  63. protected double checkingAccount() {
  64. return account;
  65. }
  66.  
  67. @Override
  68. public boolean equals(Object arg0) {
  69. if(!(arg0 instanceof User))
  70. return false;
  71. User user2 = (User) arg0;
  72. if(user2.username.equals(this.username) && user2.password.equals(this.password)){
  73. return true;
  74. }
  75. return false;
  76. }
  77. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement