import java.io.*;
public class NewClass {
//将字符串写入文件。
public void file()
{
String string = "朱北泉+李名杨 = 卡";
BufferedOutputStream bos = null;
File file = null;
try
{
file = new File("D:/zhujiali.txt");
bos = new BufferedOutputStream(new FileOutputStream(file));
byte[] date = string.getBytes();
int i = 0;
if(true)
{
String str = new String(date);
System.out.println(str);
bos.write(date);
}
}
catch (IOException ie)
{
ie.printStackTrace();
}finally
{
try
{
bos.close();
}
catch (IOException ie)
{
ie.printStackTrace();
}
}
}
public static void main(String[] args)
{
NewClass ss = new NewClass();
ss.file();
}
}