Eric Rickshaw wrote:so Im guessing where the arraylists are placed below they may be in the wrong section of the code.
It appears to me to be a simple case of trying to call methods outside of a method, constructor, static or initializer block. You can't call code like this:
in the class outside of a method, constructor, etc. This is just basic
Java, is all.
Edit: there's more involved here. I agree with your use of ArrayList here but don't agree with how you are attempting to implement it as you appear to be trying to create a separate ArrayList for each poem. If it were my app, I'd create a class to hold Poem information, say called "Poem", that would hold a
String for the author, a String for the title, and a String for the text of the poem. It would have the typical getter methods. I'd then create
one and only one arraylist of Poem that would hold all of the poems: ArrayList<Poem>. YMMV.