java - dynamically naming a text file as output -


i have loop in each iteration text file should generated. problem naming text file. because of lack of knowledge in java, don't know how should name output files dynamically. names should dependent index of loop. in advance. using printstream.

just build file name index variable.

for(int x = 0; x < 10; x++){     string filename = "file_" + x + ".txt";     file file = new file(filename); } 

Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -