This week's book giveaway is in the Agile and Other Processes forum. We're giving away four copies of Darcy DeClute's Scrum Master Certification Guide: The Definitive Resource for Passing the CSM and PSM Exams and have Darcy DeClute on-line! See this thread for details.
ujjawal, your method definition says that it can accept Number type or its super types only.
but the list you are passing to that method says that it can accept Number type or its any of its subtypes also. So as generic is compile time protection compiler cannot make sure that you will pass only Number type to that method, hence compiler error.
programming using OOP concepts makes life easier for software people. Its easy to debug, test, and most importantly it provides component reuse which is essential for faster development and to cope with changing requirements in software development.
thanks for reply.
so does it mean that elements in PriorityQueue are not stored in a sorted manner of any kind? and its just the order in which they get removed is determined by either the natural order or by a comparator.