-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathChapter06.java
More file actions
25 lines (20 loc) · 827 Bytes
/
Copy pathChapter06.java
File metadata and controls
25 lines (20 loc) · 827 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
package JavaKernelVolume1.ch06;
import JavaKernelVolume1.ch06.interfacee.Employee;
import java.util.Arrays;
public class Chapter06 {
public static void main(String[] args) {
Employee[] staff = new Employee[3];
staff[0] = new Employee("Harry Hacker", 35000, 2012, 11, 1);
staff[1] = new Employee("Carl Cracker", 75000, 2019, 8, 1);
staff[2] = new Employee("Tony Tester", 38000, 2020, 2, 11);
Arrays.sort(staff);
// print out information about all Employee objects
for (Employee e : staff)
System.out.println("name=" + e.getName() + " , salary=" + e.getSalary());
System.out.println(new Test2(){}.getClass());
System.out.println(Test2.class);
System.out.println(Test2.class instanceof Class);
}
}
interface Test2{
}