at school,
public void addTeacherName(classroom classroom, String teacherName) {
classroom.setTeacherName(teacherName);
}
BTW , use the Pascal Case for class names. In addition, I would suggest Map<String, classroom>matching the class name in the class.
Then, if you use my suggestion, this will work
public void addTeacherName(String className, String teacherName) {
classrooms.get(className).setTeacherName(teacherName);
}
source
share