Doubt in creating an array of objects

Hi all, I have a very basic doubt. Is it possible to create an array of objects for the class which we write asFileDetails_Bean FileBean[] = new FileDetails_Bean[10];If so , can we specify the value to b dynamic instead of 10? Plz help
[296 byte] By [NewJavabeea] at [2007-11-27 0:19:20]
# 1
Yes and yes.
-Kayaman-a at 2007-7-11 22:10:50 > top of Java-index,Java Essentials,Java Programming...
# 2

> Yes and yes.

Kayaman,

I have an object creation inside a loop as follows:

FileDetails_Bean fileBean= new FileDetails_Bean();

j_bean_f.setpath(File_path);

j_bean_f.setname(File_name);

j_bean_f.setsize(File_size);

j_bean_f.settype(File_type);

j_bean_f.settime(File_time);

The fileBean gets generated each and every time inside the loop.So, the previous value of the object gets lost.How to save the value of the previous object?

NewJavabeea at 2007-7-11 22:10:50 > top of Java-index,Java Essentials,Java Programming...
# 3

try the following

private FileDetails_Bean fileBean= new FileDetails_Bean[5];

for (int i=0;i<5;i++) {

fileBean[i] = new FileDetails_Bean();

}

bye for now

sat

AnanSmritia at 2007-7-11 22:10:50 > top of Java-index,Java Essentials,Java Programming...