-
Notifications
You must be signed in to change notification settings - Fork 164
Expand file tree
/
Copy pathLogger.java
More file actions
31 lines (25 loc) · 779 Bytes
/
Logger.java
File metadata and controls
31 lines (25 loc) · 779 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
package com.acme.edu;
public class Logger {
public static void log(int message) {
Printer printer = new Printer("primitive: ", message);
printer.print();
}
public static void log(byte message) {
Printer printer = new Printer("primitive: ", message);
printer.print();
}
public static void log(char ch) {
System.out.println("char: " + ch);
}
public static void log(String s) {
System.out.println("string: " + s);
}
public static void log(boolean message) {
Printer printer = new Printer("primitive: ", message);
printer.print();
}
public static void log(Object message) {
Printer printer= new Printer("reference: ", message);
printer.print();
}
}