Consider the following class definition:
public class Student {
private String name;
private int age;
private String major;
public Student(String studentName, int studentAge, String studentMajor) {
name = studentName;
age = studentAge;
major = studentMajor;
}
public String getName() {
return name;
}
public int getAge() {
return age;
}
public String getMajor() {
return major;
}
}
Assume that the following code segment appears in a class other than Student:
Student student = new Student("Alice", 19, "Computer Science");
String name = student.getName();
int age = student.getAge();
String major = student.getMajor();
System.out.println(name + " is " + age + " years old and majoring in " + major + ".");
What is printed as a result of executing the code segment?