Cuando trato de ejecutar este código:"No se puede crear una instancia del tipo ..."
import java.io.*;
import java.util.*;
public class TwoColor
{
public static void main(String[] args)
{
Queue<Edge> theQueue = new Queue<Edge>();
}
public class Edge
{
//u and v are the vertices that make up this edge.
private int u;
private int v;
//Constructor method
public Edge(int newu, int newv)
{
u = newu;
v = newv;
}
}
}
me sale este error:
Exception in thread "main" java.lang.Error: Unresolved compilation problem: Cannot instantiate the type Queue at TwoColor.main(TwoColor.java:8)
No entiendo por qué no puedo crear una instancia la clase ... Me parece correcto ...
posible duplicado de [No se puede crear una instancia del tipo Lista] (http://stackoverflow.com/questions/7960149/cannot-instantiate-the-type-listproduct) –
Raedwald