We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I have this, and I think its all wrong, I can't get my head around the syntax Also, how must I put data into this class?
class StoreStuff
{
private ArrayList<String> botle ;
private ArrayList<String> apple ;
public StoreTReesStuff ( String botle, String apple )
{
this.botle = new ArrayList<String>();
this.apple = new ArrayList<String>();
}
void addApple()
{
apple.append("Jonagold");
}
}// end
void draw()
{
InstStoreStuff.addApple();
}
Answers
I assume that line 6 is the start of the constructor, in which case it should be named after the class. And if you want to pass an ArrayList to the constructor you get -
My take would be something like this: =:)
Thank you for both answers, you guys have cleared up my confusion, now I can finish my project at last :) The last answer seems to be the most versatile, so I go with that.
Sorry about the typo, in the constructor, I remade my problem into something that I could post, and forgot to change something.