• Post Reply Bookmark Topic Watch Topic
  • New Topic

Serialization  RSS feed

 
Abrahamm Kazi
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can only the objects of classes be serialized???
can an object of a String/Integer/Float class be serialized???
Can the primitive data type's variables be serialized ???
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can only the objects of classes be serialized???
Primitives can also be serialized, take a look at java.io.DataInputStream and java.io.DataOutputStream. Any class that implements the Serializable interface can be serialized. Serializable is known as a tagging interface since it has no methods defined.

can an object of a String/Integer/Float class be serialized???
Yes since they all implement Serializable.

Can the primitive data type's variables be serialized ???
Yes as noted above.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!