Hey guys. hopefully this is pretty simple.
I'm writing a program using the Twitter4j library and need to create a new object (called a FilterQuery) upon a certain event occuring (which will happen multiple times, creating multiple filterqueries). I need to run a method from this object so I need to know what it is called. If I knew how many times this would happen I would just declare them all beforehand and name them sequentially. But since I don't know how many I am going to need, and creating them all beforehand seems very inefficient, I wondering how i could create new ones on a running tally.
Do I need to make an arraylist to put them all in? How do I add numbers dynamically (the # in the above example)
Thanks
I can be more specific about the code if that would help.
I'm writing a program using the Twitter4j library and need to create a new object (called a FilterQuery) upon a certain event occuring (which will happen multiple times, creating multiple filterqueries). I need to run a method from this object so I need to know what it is called. If I knew how many times this would happen I would just declare them all beforehand and name them sequentially. But since I don't know how many I am going to need, and creating them all beforehand seems very inefficient, I wondering how i could create new ones on a running tally.
- if(eventOccurs == true){
- FilterQuery fq# = new FilterQuery;
- fq#.follow;
- eventOccurs = false;
- }
Do I need to make an arraylist to put them all in? How do I add numbers dynamically (the # in the above example)
Thanks
I can be more specific about the code if that would help.
1