Hello,
I am studying for
SCJP 5.0 from SCJP book by Kathy Sierra and Bert Bates and had a question on auto boxing in generics
Below is the code followed by mu question
This code produces something like this:
1 3 5 6 7 8 9
size 7
peek 9
size 7
poll 9
size 6
8 7 6 5 3 1 null
HOW DOES THIS WORK?
1. return two - one
2.PQsort pqs = new PQsort(); // get a Comparator
PriorityQueue<Integer> pq2 =
new PriorityQueue<Integer>(10,pqs);
3. IN THE ABOVE CODE IF I CHANGE 10 to 100 I STILL GET THE SAME RESULT, WHY?
I APPRECIATE ALL YOUR HELP
Thank you
Sachin
(
tags added)
[ October 04, 2006: Message edited by: Barry Gaunt ]