samedi 10 janvier 2015

Reason and removal of java.lang.ClassCastException from a code


I have written a datatype that implements equals() method. I have to enqueue several nodes of this datatype in a priority queue. But if I use the standard version MinPQ.java from Princeton, it shows runtime error while trying to insert a node. The error is java.lang.ClassCastException... Why is it so?





Aucun commentaire:

Enregistrer un commentaire