ClassCastException is occuring during execution of the following code. Please solve this RunTimeError.
I am writing the object to the text file using the following code.
posted 12 years ago
Are you trying to create an User object and serialize it using the above code? It won't work this way, because what you are actually creating in the above statement is a String object. So you will get a ClassCastException when you try to cast it into an User object. Try the following code