Java写入文本

 

 

     try  
    
{
        BufferedWriter out 
= new BufferedWriter(new FileWriter("d:/3.txt"));
        out.write(
"aString");
        out.newLine();
        out.write(
"second");
        out.close();
    }
  catch  (IOException e)  {
    }

 

测试通过

 

你可能感兴趣的:(java,测试)