Priority Queue experts needed !!!
I'm having trouble storing more than one objects into Java's built-in PQ. Here is my code:
PriorityQueue<Person> pq2 = new PriorityQueue<Person>( );
Person dan = new Person("Dan", 44 );
Person john = new Person("john", 50);
/*When I try to print the whole pq2, it gets stuck. It works only when I add only one object(either john or dan) into the queue. I thought by default pq2 can hold 11 elements, so why can't I have 2 elements in the queue?