Sequence Java's object into files and deserialize from the file.

zhaozj2021-02-16  79

Package Sample;

public

Class Sample

{

Public static void main (string [] args)

Throws Exception

{

Java.io.ObjectOutputStream OS = New java.io.ObjectOutputStream (New java.io.fileoutputstream ("Object.out"));

Os.WriteObject ("Hello World.");

Java.io.objectInputStream is = new java.io.ObjectInputStream (New java.io.fileinputStream ("Object.out"));

System.out.println (is.readObject ());

}

}

转载请注明原文地址:https://www.9cbs.com/read-14911.html

New Post(0)