How do you add a student object to an ArrayList?

List<Student> students = new ArrayList<Student>(); Student foo = new Student(23, “Foo”, 22); students. add(foo); // This is how you add to a List (in this case a List of Student objects and more precisely an ArrayList of Students).

Sizin İçin Seçtik  1 milyon istihdam nedir ne işe yarar?

Leave a Reply

Your email address will not be published. Required fields are marked *