import java.util.*;
import java.io.*;
public class xie{
public static void writeFile(String str, String filename) throws Exception
{
BufferedWriter bwriter;
try
{
bwriter=new BufferedWriter(new OutputStreamWriter(new FileOutputStream(filename)));
bwriter.write(str);
bwriter.flush();
bwriter.close();
}
catch(Exception e)
{
throw e;
}
}
public static void main(String[] args){
String str1,str2;
Scanner sc=new Scanner(System.in);
System.out.println("请输入字符串:");
str1=sc.next();
System.out.println("请输入文件地址:");
str2=sc.next();
try{
writeFile(str1,str2);
}
catch(Exception e)
{ e.printStackTrace();}
}
}