I have a class, Student with this constructor.
public Student(String name, int age, Map<String, Integer> grades) {
this.setName(name);
this.setAge(age);
this.setGrades(grades);
}
when creating a Student object, how do I pass the Map argument in the constructor?
What am looking for is something similar to this:
List<Student> roster = new ArrayList<>();
roster.add(new Student("Ann Droid", 145, Arrays.asList(96, 78)));
If I had this constructor:
public Student(String name, int age, List<Integer> grades) {
this.setName(name);
this.setAge(age);
this.setGrades(grades);
}
Array.asList.