I just learned that it is better to use List here in the place of the ArrayList. I would have private List horror = new ArrayList(); When I do this, I get a compiler error for the the last 2 lines of code. After the List objects are instanstieated, they are filled with Strings and I want to get the size of the ArrayList after filling them.
Joined: Feb 07, 2005
What is the error?
Joined: Sep 16, 2005
You should always post a minimal, complete example program demonstrating your problem. That way, forum members can simple copy, paste, compile and run your code. As it is know, you didn't even tell us the error! We are left guessing! And the few lines you posted, depending on where they occur in your code, may or may not generate syntax errors. Again, learn to be a good forum member and post short but complete code.
By the way, creating non-static fields like horror but copying its size to a static field size_horror smells bad. That looks like a mistake in the making...