Vishal Hegde wrote:getting ClassCastException on the line String value=(String)it.next();
And quite apart from Matthew's good advice:
really isn't much better than:
because it doesn't
stop your program; and that means that, depending on what you're doing, you could have millions of those messages to plough through.
Until you're ready to publish, or you
know that the exception can be recovered from, you're much better off simply letting the program fail - ie, don't use
try...catch; or, if you want to avoid
throws clauses, simply re-throw the exception as a RuntimeException or java.lang.Error, viz:
That way, your program will stop as soon as it hits a problem, and you will always get a stack trace.
Winston