Login Register






Cannot cast to array list filter_list
Author
Message
RE: Cannot cast to array list #2
Do you have the code that's producing the error? Some guesses are that you're trying to assign the ArrayList<Etudiant> to a single Etudiant instance, or you're trying to use the shorthand append available in Python (+=) which isn't implemented for ArrayLists.

The most I can help without seeing the code is by suggesting that you don't (or at least shouldn't) need to do any casting. If you have some deserialized Etudiant objects, you should just be able to use the ArrayList.add() method in a loop to add them.

Just a tip, as well: you're doing a lot of unnecessary encapsulation. Instead of having all those getters and setters, you could just make your instance variables publicly accessible.
It's often the outcasts, the iconoclasts ... those who have the least to lose because they
don't have much in the first place, who feel the new currents and ride them the farthest.

Reply





Messages In This Thread
Cannot cast to array list - by Vi-Sion - 01-19-2017, 07:15 PM
RE: Cannot cast to array list - by Inori - 01-19-2017, 07:46 PM
RE: Cannot cast to array list - by Vi-Sion - 01-19-2017, 07:55 PM
RE: Cannot cast to array list - by insidious - 01-20-2017, 12:06 AM
RE: Cannot cast to array list - by DarkMuse - 01-20-2017, 07:16 AM
RE: Cannot cast to array list - by Vi-Sion - 01-20-2017, 08:48 AM
RE: Cannot cast to array list - by Vi-Sion - 01-20-2017, 11:55 AM