|
|
Optimize with a SATA RAID Storage Solution
Range of capacities as low as $1250 per TB. Ideal if you currently rely on servers/disks/JBODs
Page 6 of 9
The java.lang.Comparable interface is declared as a generic type with a single type parameter named T. This class provides an int compareTo(T o) method that compares the current object with the argument (of type T), returning a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified
object.
The SortedEmployees class lets you store Employee subclass instances that implement Comparable in an internal array. This array is sorted (via the java.util.Arrays class's void sort(Object[] a, int fromIndex, int toIndex) class method) in ascending order of the hourly wage after an Employee subclass instance is added.
Compile Listing 6 (javac GenDemo.java) and run the application (java GenDemo). You should observe the following output:
java.util.concurrent.
java.time classes you're most likely to need.