开发者

How to save and read user information (username ,password,and so on) by serializable?

开发者 https://www.devze.com 2023-01-07 06:59 出处:网络
Is write all User information to o开发者_运维问答nly a file ,or every user has a self file ? And how to write information or read information of someone?Here\'s a step-by-step guide to basic serializa

Is write all User information to o开发者_运维问答nly a file ,or every user has a self file ? And how to write information or read information of someone?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消