help in java.

Semidevil

Diamond Member
Apr 26, 2002
3,017
0
76
ok, very easy question, but I just cant do it.

I have 2 classes, a "bucket" class, and a "bucket_store" class.

I have already created a bucket store class, but now, I want to create 4 buckets and put it in the store. how do I do that?

so all I did is create a vector of buckets

Vector bucket = new Vector(4);

so how do I put them all into the store?

is it "Store.addBucket" or something??
 

notfred

Lifer
Feb 12, 2001
38,241
4
0
You didn't create a Vector of buckets, you created a Vector CALLED "bucket".

READ


You want something more like this:

Vector hash = new Vector();

for(int ii = 0; ii < 4;ii++){
hash.add(new Bucket());
}
 

Semidevil

Diamond Member
Apr 26, 2002
3,017
0
76
ok, thanx

so now I created a vector of buckets...........how do I put it in my store??

also, if I created a vector of 4 buckets, how do I differentiate them? Is there a way? just bucket1, bucket2, bucket3, and bucket4 will be fine......
 

Drakkon

Diamond Member
Aug 14, 2001
8,401
1
0
create a method in the store class that creates buckets?
the store class needs some sort of "method" or variable to add those buckets to itself and it should ahve the handling to identify the buckets as well (accessors). The vector can be recognized probobly as bucket[0], bucket[1], etc...