Hi,
Please find a dummy example for saving / restoring:
And the output:
C:\Program Files\Java\jdk1.6.0_17\bin>javac Test.java &
java Test
Test read = Test
Username = user1
Password = passwd1
UserType = type1
Test read = Test
Username = user2
Password = passwd2
UserType = type2
Test read = Test
Username = user3
Password = passwd3
UserType = type3
lakmal padmakumara wrote:Actually what i want to know is how to deserialize multiple objects in a serialized file? Thanks !
That's the downside of a binary file.
You exactly have to now its structure.
For example:
If you store three diff objects, like:
A, B & C,
you'll have to read them in exactly the same sequence.
That is: A, B & C.
Hope this helps.
Regards,
Rok