-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathUser.java
29 lines (23 loc) · 815 Bytes
/
User.java
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
public abstract class User
{
//MAKE YOUR FIELDS PRIVATE WHEN USING ANY CLASS FOR BETTER CODE PRACTICE
private String firstName;//fieldA
private String lastName;//fieldB
private boolean isVerified = false;
//Remember this is an abstract class which means
//we will not be invoking the constructor directly
//Which means to not call it within our calling program
//But in our Student Class
//I create a User Constructor
public User(String fName, String lName)
{
//Remember fieldName=parameterName
//NOTTT parameterName=fieldName
firstName=fName;
lastName=lName;
}
}
//Remember this is an abstract class which means
//we will not be invoking the constructor directly
//Which means to not call it within our calling program
//But in our Student Class