import java.io.IOException;
public class StringBuilderTest1
{
public static void main(String[] args) throws IOException {
int ver = 10;
StringBuilder sb = null;
for(int i=1;i<10;i++)
{
sb = new StringBuilder().append("e:\\file").append(i).append(".txt");
String x = new String(sb);
System.out.print(x);
File file = new File(x);
if(file.createNewFile()) {
System.out.println(" file created");
}
else
{
System.out.print("file already exists");
}
}
}
}
Brak komentarzy:
Prześlij komentarz