Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- public class Demo_2 {
- public static void main(String[] args) throws IOException {
- for (int i = 1; i <= 100; i++) {
- File file = new File("C:\\Users\\I353529\\Desktop\\100_files\\file_" + i + ".txt");
- BufferedWriter writer = new BufferedWriter(new FileWriter(file));
- writer.write(file.getName());
- writer.write("\n");
- writer.write(file.getPath());
- writer.close();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment