-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUser.java
More file actions
68 lines (62 loc) · 1.7 KB
/
Copy pathUser.java
File metadata and controls
68 lines (62 loc) · 1.7 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import java.util.*;
import java.io.Serializable;
/**
* This is a User abstract class
* @author Andre Ke
* @author Ryan Su
* @author Wesley Goh
* @author Zilin Weng
* @version Java 17.0.1
*/
abstract class User extends Person{
private static final long serialVersionUID = -4132515889029963589L;
private String username;
private String password;
/**
* Explanation - constructs an instance of the User class
* @param name - a String that represents the user's name
* @param age - a number that represents the user age
* @param gender - a String that represents the user gender
* @param dateOfBirth - a String that represents the user date of birth
* @param phoneNumber - a String that represents the user phone number
* @param emailAddress - a String that represents the user email address
*/
public User(String name, int age, String gender, String dateOfBirth, String phoneNumber, String emailAddress){
super(name, age, gender, dateOfBirth, phoneNumber, emailAddress);
}
/**
* Explanation - gets name
* @return a String stored in name
*/
public String getName(){
return super.name;
}
/**
* Explanation - gets username
* @return a String stored in username
*/
public String getUsername(){
return username;
}
/**
* Explanation - gets password
* @return a String stored in password
*/
public String getPassword(){
return password;
}
/**
* Explanation - sets username
* @param newUsername as a String
*/
public void setUsername(String newUsername){
this.username = newUsername;
}
/**
* Explanation - sets password
* @param newPassword as a String
*/
public void setPassword(String newPassword){
this.password = newPassword;
}
}