Appendix. Answers to “Twist in the Tale” exercises

Chapters 112 include numerous “Twist in the Tale” exercises. The answers to these exercises are given in this appendix, with comprehensive explanations. The answer to each exercise includes the following elements:

  • Purpose The aim of the exercise (the twist to which each exercise is trying to draw your attention)
  • Answer The correct answer
  • Explanation A comprehensive explanation of the answer

Let’s get started with the first chapter.

A.1. Chapter 1: Java class design

Chapter 1 includes 4 “Twist in the Tale” exercises.

A.1.1. Twist in the Tale 1.1

Purpose: This exercise demonstrates how decreasing the accessibility of an entity by changing its access modifier might impact the code ...

Get OCP Java SE 7 Programmer II Certification Guide: Prepare for the 1ZO-804 exam now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.