We're beginners at Java so please don't give too advanced answers.
We're currently working on a school project and we're stuck. The purpose with the code is to add an event to an ArrayList but we keep getting an error every time we use add, not just in this part of the code.
Thankful for any answer
/Evangelina
eventList?Eventto aList<String>that you defined as only holding StringseventListisArrayList<String>then it isn't going to accept anything but a string. And seeing as you can't extend string, you're going to have to insert a string not an Event.for( String eventList : set )you cannot reuse the name of a list as a string variable, you might want to change it toeventNameor such.eventListis defined outside the method, so you can both use that field in the method, and define a variable of the same name. (But can != should).