• Post Reply Bookmark Topic Watch Topic
  • New Topic

Is an array object serializable?

 
Daniel D. Guo
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Ranchers,

Could anybody tell me whether an array object is serializable? I need to know in an rmi application.

Thanks,
Dan
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What happened when you tried to serialize it?
 
Henrique Sousa
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An array object is serializable if all its elements are serializable. For instance, java.util.Date is serializable so an array java.util.Date[] is also serializable.
If you declare an array as java.lang.Object[] and fill it with java.lang.Integer and java.util.Date instances you'll be fine, but if you also insert a java.jdbc.Connection in there you will have problems during serialization. Does this answer your question?
 
Daniel D. Guo
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot! guys.

Actually, I have not tried to serialize an array object.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!