AP Computer Science A Quiz
20 questions · no time limit
0:00
USING OBJECTS AND METHODS
Question 1 of 20
No time limit
Current
Answered
Flagged
Not seen
PASSAGE
public class Student { private String name; private int grade; public Student(String n, int g) { name = n; grade = g; } public String getName() { return name; } public int getGrade() { return grade; } public void setGrade(int g) { grade = g; } }
Consider the following code segment that creates and manipulates Student objects: Student s1 = new Student("Alice", 85); Student s2 = new Student("Bob", 92); Student s3 = s1; s3.setGrade(88); s2 = s3; After this code executes, what are the grades of the objects referenced by s1, s2, and s3?
YOUR PROGRESS
20
QUESTIONS
Ready when you are
Answer in any order. Your progress shows here as you go.
QUESTIONS
KEYBOARD
Pick an answer ABCD
Next question ↵→
Previous ←
Flag for review F