Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Basic Java Serialization question  RSS feed

 
K Duke
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
In what order do parameters of a class get serialized using writeObject(ObjectOutputStream)
Assume a class Person:
class Person {
private int age;
private String firstName;
private String lastName;
private String hometown;
....
}
SO when I do the foll:
Person p;
p.writeObject(oostream);
Will the parameters get written in the order they are declared in the class?
i.e. age, firstName, lastName, hometown
OR
Are they serialized in alphabetical sequence? i.e age, firstName, hometown, lastName??
Thanks,
[ March 24, 2004: Message edited by: K Duke ]
[ March 24, 2004: Message edited by: K Duke ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!