getting multiple notepad out put files
hello
i'm trying to make a java program that writes out multiple files to a folder in my documents. However, i'm confused on how to make a for statement that would output a lot of files, while making them still write and not have to replace the previous one.......
this is my program
import java.io.*;
public class notePad{
public static void main(String args[]){
try{
File infile = new File("C:/Documents and Settings/c1s5/My Documents/Allah/sample.txt");
FileOutputStream fos = new FileOutputStream(infile);
PrintWriter out = new PrintWriter(fos);
out.println("This is the sample text in the notepad");
out.flush();
out.close();
}catch(Exception e){}
}
}
and i want to be able to manipulate the sample so that it goes sample 1...sample 2..for every time it runs though the for statement....also, i want to make it output more than one file....anyone have an idea how i can do this...its my fourth month in java...so i'm a noob
hwrd

