import java.util.ArrayList;
import java.util.List;
public class Student {
private String name;
private int age;
public Student(String name, int age) {
this.name = name;
this.age = age;
}
// Getters and setters
public static void main(String[] args) {
List<Student> students = new ArrayList<>();
students.add(new Student("Alice", 20));
students.add(new Student("Bob", 21));
students.add(new Student("John", 22));
for (Student student : students) {
System.out.println("Name: " + student.getName() + ", Age: " + student.getAge());
}
}
}