collection of files

Hi guys

i have 10 files like

File f1=new File("path of file 1");

File f2=new File("path of file 2");

.

.

.

.

File f10=new File("path of file 10");

can i add all these files into an array?

thanks&regards

srihari

[295 byte] By [sriharireddya] at [2007-11-15]
# 1

Well, did you try?

georgemca at 2007-7-29 > top of java,Core,Core APIs...
# 2

i think the question is what CAN'T you put into an array :-)

SoulTech2012a at 2007-7-29 > top of java,Core,Core APIs...
# 3

> i think the question is what CAN'T you put into an

> array :-)

yah, you could even make recursive arrays if you really wanted to :)

jwentinga at 2007-7-29 > top of java,Core,Core APIs...
# 4

..

File[] junkFiles = new File[10];

for( int i = 0; i < junkFiles.length; i++ )

junkFiles[i] = new File("StupidFileName" + i + ".txt");

...tada!

smithdale87a at 2007-7-29 > top of java,Core,Core APIs...
# 5

> ..

> [code]

> File[] junkFiles = new File[10];

>

> for( int i = 0; i < junkFiles.length; i++ )

> junkFiles = new File("StupidFileName" + i +

> ".txt");

> /code]

> ...tada!

The OP has just been "number 2s". He requests that you attend to his wiping needs

georgemca at 2007-7-29 > top of java,Core,Core APIs...