forked from Dmitriy-G/JavaPrograms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUser.java
More file actions
36 lines (28 loc) · 654 Bytes
/
Copy pathUser.java
File metadata and controls
36 lines (28 loc) · 654 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
35
36
/**
* Created by Dima on 23.09.2015.
*/
public class User {
private String userAction;
private int userNumber;
private int incorrectNumbers=0;
public int getUserNumber() {
try {
userNumber=Integer.parseInt(userAction);
}catch (NumberFormatException e){
incorrectNumbers++;
return -1;
}
return userNumber;
}
//getters
public int getIncorrectNumbers() {
return incorrectNumbers;
}
//setters
public void setUserAction(String userAction) {
this.userAction = userAction;
}
//constructors
public User() {
}
}