import java.io.*;
public class Piped
{ public static void main(String[] args)
{InputStream i=null;
OutputStream i2=null;
ObjectInputStream oi=null;
ObjectOutputStream oi2=null;
try
{
i=new FileInputStream("E:/nn.txt"); i2=new FileOutputStream("E:/nn.txt");
}
catch(IOException e)
{
e.getMessage();
}
try
{
oi=new ObjectInputStream(i);
}
catch(IOException e)
{
}
try
{
oi2=new ObjectOutputStream(i2);
}
catch(IOException e)
{
e.printStackTrace();
}
try
{
oi2.writeObject(new Per(100));
oi2.close();
}
catch(IOException e)
{
e.getMessage();
}
Per p=null;
try
{
p=(Per)oi.readObject();
oi.close();
}
catch(Exception e)
{
e.getMessage();
}
p.pp();
}}
class Per implements Serializable
{
int i;
public void pp()
{
System.out.println(i);
}
Per(int j)
{
i=j;
}
Per()
{
i=500;
}
}
public class Piped
{ public static void main(String[] args)
{InputStream i=null;
OutputStream i2=null;
ObjectInputStream oi=null;
ObjectOutputStream oi2=null;
try
{
i=new FileInputStream("E:/nn.txt"); i2=new FileOutputStream("E:/nn.txt");
}
catch(IOException e)
{
e.getMessage();
}
try
{
oi=new ObjectInputStream(i);
}
catch(IOException e)
{
}
try
{
oi2=new ObjectOutputStream(i2);
}
catch(IOException e)
{
e.printStackTrace();
}
try
{
oi2.writeObject(new Per(100));
oi2.close();
}
catch(IOException e)
{
e.getMessage();
}
Per p=null;
try
{
p=(Per)oi.readObject();
oi.close();
}
catch(Exception e)
{
e.getMessage();
}
p.pp();
}}
class Per implements Serializable
{
int i;
public void pp()
{
System.out.println(i);
}
Per(int j)
{
i=j;
}
Per()
{
i=500;
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货