“no suitable method found for add(java.lang.String)”in arraylist constructor?
问题 import java.util.ArrayList; import java.util.Random; public class College { // instance variables - replace the example below with your own private ArrayList<Student> students; public College() { // initialise instance variables ArrayList<Student> students = new ArrayList<Student>(); students.add("Student 1"); students.add("Student 2"); students.add("Student 3"); } } basically it highlights the .add showing the error message "java.lang.IllegalArgumentException: bound must be positive", I don