0

I have a class called "Ship" that contains many "Block" instances (an array list of block objects). The blocks in the array list are classes that extend Block such as HullBlock, does Block and all classes extending it need to implement serialisable for the ship to be successfully written to a file. Also what is the file type you would serialise too?

Thanks

  • Yes... and any type of file you want... it can be a `somename.thisisamdeupextension` if you wanted it to be or you can simply do.. `somename.r` – 3kings Sep 01 '16 at 04:29
  • Alright thanks guys sorry for the dupe I didn't go looking for an exception so I must of missed that – GarryNewman Sep 01 '16 at 04:31

1 Answers1

0

You need to implement Bulk class with Serializable interface so that you can serialize List of both Bulk and HullBulk classes. If you don't wish to serialize make the list as transient.

user207421
  • 305,947
  • 44
  • 307
  • 483
Mukesh
  • 182
  • 1
  • 2
  • 10