Topics from Week 01 review slides — What is OOP, benefits of OOP
Question 1 — True / False
Object-oriented programming (OOP) allows programmers to define not only the data type of a data structure, but also the types of operations (functions) that can be applied to the data structure.
Question 2 — Multiple Choice
Which of the following is NOT a benefit of OOP as discussed in the review?
Question 3 — True / False
The idea of OOP is to implement real-world entities like inheritance, hiding, and polymorphism in programming.
Question 4 — Multiple Choice
According to the lecture, the purpose of OOP is to bind together:
Section 2: Java Basics & Java vs Python
Compilation, JVM, types, syntax differences — from Week 01 review
Question 5 — True / False
Java is an interpreted language, while Python is a compiled language.
Question 6 — Multiple Choice
What does JVM stand for?
Question 7 — Multiple Choice
In Java, how do you signify blocks of code?
Question 8 — True / False
In Java, a semicolon ; signals the end of a statement. Your program will fail to compile if a statement does not end with a semicolon.
Question 9 — Multiple Choice
Java is described as a strongly and explicitly typed language. What does this mean?
Question 10 — Multiple Choice
The output from the Java compiler is called:
Question 11 — Multiple Choice
Which of the following is NOT a primitive type in Java?
Question 12 — Multiple Choice
In Java, && represents the logical ______ operator, and || represents the logical ______ operator.
Question 13 — Multiple Choice
Java was originally developed by James Gosling at:
Question 14 — True / False
In Java, all functions (methods) must declare their return type.
Section 3: Classes & Objects
State, functionality, classes as blueprints — from Weeks 02–03 review
Question 15 — Multiple Choice
A class is best described as:
Question 16 — Multiple Choice
Given the analogy from the lecture: "Dog" is the class, "Scooby Doo" is the ______.
Question 17 — Multiple Choice
In the lecture's Dog example, which of the following would be considered state (data) of the Dog object?
Question 18 — True / False
Everything in Java is an Object, including primitive types like int and boolean.
Question 19 — Multiple Choice
Consider the following code from a Vehicle class. What is the return type of a constructor?
public classVehicle {
publicVehicle(int numWheels, int numDoors, String name) {
// set member variables
}
}
Question 20 — Multiple Choice
Looking at this code from the Book class used in Lab 3, what does the constructor do?
publicBook(String n, int p, boolean s) {
name = n;
page = p;
stock = s;
}