-
Notifications
You must be signed in to change notification settings - Fork 74
Expand file tree
/
Copy pathLogginLab.java
More file actions
43 lines (30 loc) · 1.13 KB
/
LogginLab.java
File metadata and controls
43 lines (30 loc) · 1.13 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
import java.util.logging.Level;
import java.util.logging.Logger;
public class LogginLab {
private final static Logger logger = Logger.getLogger(LogginLab.class.getName());
private Integer threshold = 0;
public LogginLab() {
this.threshold = 0;
}
public static void main(String[] args) {
logger.log(Level.INFO, "Hello World!");
logger.log(Level.SEVERE, "Terrible Error!");
logger.log(Level.WARNING, "Not So Bad Error!");
logger.log(Level.INFO, "****\n\tAt ZipCode, \n\twe don't use System.out.Println \n\tuntil we've earned the right.\n****");
}
public Integer getThreshold() {
return threshold;
}
public void setThreshold(Integer threshold) {
this.threshold = threshold;
}
public boolean thresholdExceeds(Integer limit) {
return (this.threshold > limit);
}
// Write a method called thresholdReached, returns true if argument 'limit' is over the threshold.
// Write a test for the method in the Test class.
public boolean thresholdReached (Integer limit) {
if (this.threshold < limit) {
}return true;
}
}