Chapter FIVE
Controlling Program Flow


Exam Objectives

Create program flow control constructs including if/else, switch statements and expressions, loops, and break and continue statements.
Implement inheritance, including abstract and sealed types as well as record classes. Override methods, including that of the Object class. Implement polymorphism and differentiate between object type and reference type. Perform reference type casting, identify object types using the instanceof operator, and pattern matching with the instanceof operator and the switch construct.

Answers

1. The correct answer is A.

Explanation:

2. The correct answer is D.

Explanation:

3. The correct answer is C.

Explanation:

4. The correct answer is C.

Explanation:

5. The correct answer is B.

Explanation:

6. The correct answer is A.

Explanation:

7. The correct answer is D.

Explanation:

8. The correct answer is B.

Explanation:

9. The correct answer is C.

Explanation:

10. The correct answer is A.

Explanation:

Do you like what you read? Would you consider?


Do you have a problem or something to say?

Report an issue with the book

Contact me