-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUser.java
More file actions
31 lines (25 loc) · 695 Bytes
/
User.java
File metadata and controls
31 lines (25 loc) · 695 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
package cafeteria;
class User {
private String name;
private String userID;
private String contactNumber;
public User(String name, String userID, String contactNumber) {
this.name = name;
this.userID = userID;
this.contactNumber = contactNumber;
}
public String getName() {
return name;
}
public String getUserID() {
return userID;
}
public String getContactNumber() {
return contactNumber;
}
public void printUserDetails() {
System.out.println("Name: " + name);
System.out.println("User ID: " + userID);
System.out.println("Contact Number: " + contactNumber);
}
}