-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUser.java
More file actions
34 lines (28 loc) · 768 Bytes
/
User.java
File metadata and controls
34 lines (28 loc) · 768 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import java.util.*;
public class User {
protected String username;
protected String password;
protected String email;
User(String username, String password, String email) {
this.username = username;
this.password = password;
this.email = email;
}
String getUserName() {
return this.username;
}
String getPassword() {
return this.password;
}
String getEmail() {
return this.email;
}
public static User login(Vector<User> users, String username, String password) {
for (User user : users) {
if (user.getUserName().equals(username) && user.getPassword().equals(password)) {
return user;
}
}
return null;
}
}