Alerander
发贴: 8
积分: 0
|
于 2004-09-06 11:34
import java.io.*; class TestOneDeposit{ public static void main(String[] args)throws IOException{ boolean b=false; OneDeposit od=new OneDeposit("19860923","liye","fafadf","fafasf","fafafda", "fafdfa","wew","wee",b); OneDeposit odd=new OneDeposit("19660923","yydhe","fafadf","fafasf","fafafda", "fafdfa","wew","wee",b); od.createFiles(); RandomAccessFile out=new RandomAccessFile("存款文件.dat","rw"); od.write(out); odd.write(out); } }
》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》
import java.io.*; class TestOneDeposit2{ public static void main(String[] args)throws IOException{ boolean b=false; OneDeposit od=new OneDeposit(); RandomAccessFile in=new RandomAccessFile("存款文件.dat","rw"); od.read(in,"19860923"); System.out.println(od.number+od.name+od.password+od.capital+od.sort+od.saveDay+od.address+od.saveAssistant+od.isLost); } }
》》》》》》》》》》》》》》》
这就是刚刚的测试程序,很简单的
|