Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Raju Iyer   on Apr 01 In Java Category.

  
Question Answered By: Kian Evans   on Apr 01

here is a solution,

import java.io.*;
public class FileTest
{
public FileTest()
{
try{
File outputFile = new File("prova.txt");
FileWriter myout = new FileWriter(outputFile);
for(int i=0;i<100;i++)
{
myout.write("X:"+i);
myout.write("\n");
}
myout.flush();
}catch(Exception ex){ex.printStackTrace();}
}

public static void main(String args[])
{
new FileTest();
}
}

Please open the prova.txt file  with wordpad. See you
have done it.

Share: 

 

This Question has 2 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on I am using .write("") Or get search suggestion and latest updates.


Tagged: