Hi,
I have an array list of objects in my application.
private static ArrayList<Player> userList=new ArrayList<Player>();
In my application, I am converting this list to byte array and then sending it to other clients. At client When I am trying to cast it back to the ArrayList, its giving me casting error. I am doing this in client side after receiving this list as byte array:
ArrayList<Player> pl = (ArrayList<Player>) toObject(receivedByteArray);
where toObject is my function to convert the byte array to object;
Any Suggestions please !!!
Thanks.
java.lang.ClassCastException: Player cannot be cast to java.util.ArrayList
at Client.attemptLogin(Client.java:242)
at Client.main(Client.java:64)