• Post Reply Bookmark Topic Watch Topic
  • New Topic

how is the code working

 
Gajendra Kangokar
Ranch Hand
Posts: 94
1
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello everyone
in the below code to serialize.
my question is what is the role of FileOutputStream,ObjectOutputStream and writeObject .How are the actually working in the below code.



is it necessary that all the serialized file should be with the extension .ser?

Thank you
 
Tony Docherty
Saloon Keeper
Posts: 3138
72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my question is what is the role of FileOutputStream,ObjectOutputStream and writeObject .

Do you know what Output Streams do?

is it necessary that all the serialized file should be with the extension .ser?
No, you can use whatever extension you want to but .ser is commonly used for serialised files and it's best if you don't use an extension which already has a different standard meaning such as .txt, .doc, .gif etc as it would just be confusing.
 
Gajendra Kangokar
Ranch Hand
Posts: 94
1
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you know what Output Streams do?


i do not know much about I/O streams.i only know that I/O streams are used to read and write on a file.
 
Tony Docherty
Saloon Keeper
Posts: 3138
72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i do not know much about I/O streams.i only know that I/O streams are used to read and write on a file.

They certainly are used to read and write files but that isn't the total extent of what they can do.

I suggest you read an I/O tutorial first and if you are still unsure then ask here and we will try to clarify the bits you are still unsure on.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!