Sophia - Intro to Java (3) - Unit 3 Practice Test 2025-
2026 Guide
1. What is the term used to bundle the structure and C.)
design of code when implementing object-oriented objects
programming?
A.)
methods
B.)
data collection types
C.)
objects
D.)
classes
2. Object-oriented programming provides what three A.)
traits to programs? reusability, scalability, and
A.) eflciency
reusability, scalability, and efficiency
B.)
reusability, scalability, and inefficiency
C.)
recursion, scalability, and efficiency
D.)
reusability, simulation, and efficiency
3. What are the four basic programming structures for B.)
writing code in Java? sequential, conditional,
A.) repetitive, and reusable
sequential, divisional, repetitive, and reusable
B.)
sequential, conditional, repetitive, and reusable
C.)
sequential, conditional, relational, and reusable
, Sophia - Intro to Java (3) - Unit 3 Practice Test 2025-
2026 Guide
D.)
consecutive, conditional, repetitive, and disposable
4. When is the constructor declared for an instance of an A.)
object? At class instantiation
A.)
At class instantiation
B.)
At deletion
C.)
When a method is called
D.)
When an attribute is assigned
5. The constructor is used to initialize what components C.)
of an instance of an object? Its attributes
A.)
Its methods
B.)
Its scope
C.)
Its attributes
D.)
Its structure
6. Which type of constructor will initialize the instance C.)
variables to initial values without them needing to be default
set?
A.)
object
B.)
parameterized
, Sophia - Intro to Java (3) - Unit 3 Practice Test 2025-
2026 Guide
C.)
default
D.)
instance
7. Given the following class, what sets of statements C.) Student myStudent =
would have the end result of the myStudent instance new Student("student
having the student name as teststudent letterGrade as name","X");
test as B? myStudent.setStudent-
Name("teststudent");
public class Student { private String studentName; myStudent.setLetter-
private String letterGrade; public Student(String stu- Grade("B");
dentName, String letterGrade) { this.studentName =
studentName; this.letterGrade = letterGrade; } pub-
lic String getStudentName() { return studentName;
} public String getLetterGrade() { return letterGrade;
} public void setStudentName(String studentName) {
this.studentName = studentName; } public void setLet-
terGrade(String letterGrade) { this.letterGrade = letter-
Grade; } }
A.) Student myStudent = new Student();
myStudent.setStudentName("teststudent"); myStu-
dent.setLetterGrade("B");
C.) Student myStudent = new Student("stu-
dent name","X"); myStudent.setStudentName("test-
student"); myStudent.setLetterGrade("B");
8. Given the following class, what sets of statements User myUser = new
would have the end result of the myUser instance User("username","pass-
having the username as testuser and the password as word");
2026 Guide
1. What is the term used to bundle the structure and C.)
design of code when implementing object-oriented objects
programming?
A.)
methods
B.)
data collection types
C.)
objects
D.)
classes
2. Object-oriented programming provides what three A.)
traits to programs? reusability, scalability, and
A.) eflciency
reusability, scalability, and efficiency
B.)
reusability, scalability, and inefficiency
C.)
recursion, scalability, and efficiency
D.)
reusability, simulation, and efficiency
3. What are the four basic programming structures for B.)
writing code in Java? sequential, conditional,
A.) repetitive, and reusable
sequential, divisional, repetitive, and reusable
B.)
sequential, conditional, repetitive, and reusable
C.)
sequential, conditional, relational, and reusable
, Sophia - Intro to Java (3) - Unit 3 Practice Test 2025-
2026 Guide
D.)
consecutive, conditional, repetitive, and disposable
4. When is the constructor declared for an instance of an A.)
object? At class instantiation
A.)
At class instantiation
B.)
At deletion
C.)
When a method is called
D.)
When an attribute is assigned
5. The constructor is used to initialize what components C.)
of an instance of an object? Its attributes
A.)
Its methods
B.)
Its scope
C.)
Its attributes
D.)
Its structure
6. Which type of constructor will initialize the instance C.)
variables to initial values without them needing to be default
set?
A.)
object
B.)
parameterized
, Sophia - Intro to Java (3) - Unit 3 Practice Test 2025-
2026 Guide
C.)
default
D.)
instance
7. Given the following class, what sets of statements C.) Student myStudent =
would have the end result of the myStudent instance new Student("student
having the student name as teststudent letterGrade as name","X");
test as B? myStudent.setStudent-
Name("teststudent");
public class Student { private String studentName; myStudent.setLetter-
private String letterGrade; public Student(String stu- Grade("B");
dentName, String letterGrade) { this.studentName =
studentName; this.letterGrade = letterGrade; } pub-
lic String getStudentName() { return studentName;
} public String getLetterGrade() { return letterGrade;
} public void setStudentName(String studentName) {
this.studentName = studentName; } public void setLet-
terGrade(String letterGrade) { this.letterGrade = letter-
Grade; } }
A.) Student myStudent = new Student();
myStudent.setStudentName("teststudent"); myStu-
dent.setLetterGrade("B");
C.) Student myStudent = new Student("stu-
dent name","X"); myStudent.setStudentName("test-
student"); myStudent.setLetterGrade("B");
8. Given the following class, what sets of statements User myUser = new
would have the end result of the myUser instance User("username","pass-
having the username as testuser and the password as word");