1 Fill in the blank. In Java, each class can have ________________.
Choose one answer. a. Only one subclasses
b. Only one superclass
c. State and behavior from only one other class
d. More than one subclass and superclass
2 What are the instances of an object called?
Choose one answer. a. Bundle
b. Function
c. Method
d. Object
3 Which of the following is a characteristic of an object?
Choose one answer. a. Behavior
b. State
c. Both A and B
d. None of the above
4 Which of the following is an advantage of object-oriented code?
Choose one answer. a. Code reuse
b. Information-hiding
c. Modularity
d. All of the above
https://saylordotorg.github.io/LegacyExams/CS/CS407/CS407-FinalExam-Answers.html 1/24
,11/28/26, 11:15 PM CS407-FinalExam-Answers
5 A method in Java is used to change the state in which of the following?
Choose one answer. a. Class
b. Object
c. Program
d. All of the above
6 An object includes which of the following?
Choose one answer. a. Behavior
b. Field
c. State
d. All of the above
7 Data encapsulation includes which of the following?
Choose one answer. a. Internal state
b. Behavior
c. Method
d. All of the above
8 Which of the following is a Java package?
Choose one answer. a. Class
b. Interface
c. Namespace
d. Relationship
9 Which of the following statement best describes an interface?
Choose one answer.
https://saylordotorg.github.io/LegacyExams/CS/CS407/CS407-FinalExam-Answers.html 2/24
,11/28/26, 11:15 PM CS407-FinalExam-Answers
a. Implementing an interface formally describes the behavior it provides.
b. Methods defined by the interface do not have to appear in its source code to compile.
c. The interface does not form its “contract” between the class and the outside world until the compiled program is run.
d. All of the above
10 With inheritance, a class can have which of the following?
Choose one answer. a. A commonly used state from another class
b. A rarely used behavior from a number of other classes
c. Only one subclass
d. All of the above
11 Which of the following statements best describes a race condition in a multi-threaded program?
Choose one answer. a. Another thread may change or invalidate a result before the originating thread completes its sequence.
b. A race condition only exists when counting is in process.
c. The thread involves a sequence of actions, but each action is independent of a previous action.
d. All of the above
12 Which of the following statements best describes how networks that use blocking apply multi-threading?
Choose one answer. a. At any given time the number of active threads may only be a fraction of the total number of threads.
b. The number of active threads should be comparable to the number of available processors.
c. Network operations may choose to block a thread that handles communication with a client.
d. All of the above
13 Which of the following statements best describes using a thread pool?
Choose one answer. a. A thread pool is a large collection of threads available for tasks to be performed.
b. A new task is assigned to a thread in the pool rather than creating a new thread.
https://saylordotorg.github.io/LegacyExams/CS/CS407/CS407-FinalExam-Answers.html 3/24