my dog learned polymorphism
The moose likes Beginning Java and the fly likes Queue compile error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Queue compile error" Watch "Queue compile error" New topic

Queue compile error

meeta gaur
Ranch Hand

Joined: Dec 05, 2012
Posts: 305 error: cannot infer type arguments for PriorityQueue<>;
Queue<Integer> intQueue=new PriorityQueue<>(5,rs);
reason: no instance(s) of type variable(s) E exist so that PriorityQueue<E> conforms to Queue<Integer>
where E is a type-variable:
E extends Object declared in class PriorityQueue
1 error

My one regret in life is that I am not someone else.
- Woody Allen
meeta gaur
Ranch Hand

Joined: Dec 05, 2012
Posts: 305

Yea, i got my mistake.
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 46412
And what was the mistake?
I agree. Here's the link:
subject: Queue compile error
It's not a secret anymore!