This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line! See this thread for details.
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: