Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How does Hashtable attribute of a class get serilized?

 
devasis majhi
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Elements in Hashtable get stored in an Array of Entry. i.e .transient Entry<K, V>[] elementData; elementData is a transient variable. Then how does a Hashtable attribute of a class get serialized ?

EX:-

class A
{
public Hashtable<String,String> ht;
}
 
Steve Luke
Bartender
Posts: 4181
21
IntelliJ IDE Java Python
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It has writeObject()/readObect() to customize the serialization process.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic