order of an elements in a java collection can be either in natural order of the data in the collection [i.e. if that collection implemnts java.lang.Comparable interface] or data can be in any order if that collection implements java.lang.Comparator.
My doubt is below Employee code implements java.lang. Comparable interface.
___________________________________________________________________________ I would like to print Employees based on the DEPTNO. I am getting the following OUTPUT: