I'm trying to modify an object within a class, but have those changes persist up to the class that called this class and passed the object. Here's some code to make it more clear.
I have a class called AddCourseForm, here's its constructor:
public AddCourseForm(CourseData c) {
addOrEdit = 0; //default add mode
initComponents();
courseList = c;
}
where courseList is aprivate CourseData courseList;
What I want to be able to do is use the courseList in my AddCourseForm class (add, remove things) but have those changes persist to the CourseData c that's passed to the constructor, but I'm not really sure what to do here. I know how I can make the changes persist if I'd passed CourseData c directly to a method, but not how to do it this way.
CourseDatathat you want to persist?