views:

23

answers:

1

Is write all User information to only a file ,or every user has a self file ? And how to write information or read information of someone?

A: 

Here's a step-by-step guide to basic serializaiton in java:

  1. Import java.io.Serializable

  2. List item

Get your data-containing class to implement Serializable.

    public class MyClass implements Serializable {

3. Use an Object I/O stream to read/write your objects from files.

Here is a great concise tutorial: http://www.javabeginner.com/uncategorized/java-serialization

hb2pencil