public class testCast {
public interface dataQueue extends Queue<Object>{};
public static void main (String test[]){
dataQueue queue = (dataQueue) new java.util.PriorityQueue<Object>();
queue.add("Test");
System.out.println(queue.peek());
}
}
I am wondering why this would cause a casting error.... it would work if I do
Queue queue = (Queue) new java.util.PriorityQueue<Object>();
Does anyone know why??
Thanks in advance