File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Queue compile error" Watch "Queue compile error" New topic
Author

Queue compile error

meeta gaur
Ranch Hand

Joined: Dec 05, 2012
Posts: 305


PriorityQueueMethods.java: 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
Sheriff

Joined: Oct 13, 2005
Posts: 38044
    
  22
And what was the mistake?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Queue compile error
 
Similar Threads
Print contents of PriorityQueue not working
generics doubt from nikos
Reverse Sort
Priority Queue Ordering
Regarding PriorityQueue