Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript 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 ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!