View Single Post
Old May 7th, 2008, 5:33 AM   #1
Lakrids
Newbie
 
Join Date: Dec 2007
Posts: 28
Rep Power: 0 Lakrids is on a distinguished road
PriorityQueue problem

Hello,

I am writing a program which needs at a certain point the use of priority queues. For that I use java.util.PriorityQueue. The problem is that javac refuses to compile my code, and I just don't understand why. For the following code :
java Syntax (Toggle Plain Text)
  1. // ...
  2. import java.util.PriorityQueue;
  3. // ...
it says
Error : The import java.util.PriorityQueue cannot be resolved
WHY? It is supposed to be there!!
Even with
java Syntax (Toggle Plain Text)
  1. // ...
  2. import java.util.*;
  3. // ...
  4. PriorityQueue q = new PriorityQueue();
or
java Syntax (Toggle Plain Text)
  1. // ...
  2. import java.*;
  3. // ...
  4. PriorityQueue q = new PriorityQueue();
it gives
Error : PriorityQueue cannot be resolved to a type

What is the problem?
Lakrids is offline   Reply With Quote