java.lang.ClassCastException
I am trying to do the following and I am getting the exception:
Node new_node=new Node(label);
total_nodes.add(new_node);
The total_nodes is of class TreeSet.
And especially:
at java.util.TreeMap.compare(TreeMap.java:1093)
at java.util.TreeMap.put(TreeMap.java:465)
at java.util.TreeSet.add(TreeSet.java:210)
at ask4.Graph.insertVertex(Graph.java:42)
I have done this only once when my tree is empty.But in the second time I get the exception.If anyone can help I would be grateful.
Thanks.