Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to serialize HashSet

Tags:

java

android

i'm building an android app and i want to add a history function. I heard that i can serialize a list to be able to save and retrieve data instead of using a Database, i have no idea how it works so i come here and ask for advice, is there somewhere i could get started with this. Some good links could be useful.

Thanks

like image 756
Ernesto Delgado Avatar asked Jun 13 '26 09:06

Ernesto Delgado


1 Answers

HashSet implements Serializable. So as long as all the objects you put inside your hash set also implements Serializable (and all objects inside them again etc.), you can serialize it as any other normal serializable java object.

like image 65
Julian Avatar answered Jun 14 '26 23:06

Julian