Appendix A. Answers

Answers to Chapter 1

Reviewing It

Reviewing It

A1:

Five features that Java uses to help you write “bug-free” code are the absence of unsafe constructs (such as pointers, operator overloading, destructors, memory deletion, and multiple implementation inheritance), support for arrays with bounds checking, a completely object-oriented language that promotes reusability, no undefined or architecture-dependent constructs (such as types whose sizes vary from platform to platform), and strict type checking.

A2:

Sun's Java compiler requires you to specify a .java file extension to make it harder to compile anything but Java source code. For example, ...

Get Java™ 2 by Example, Second Edition now with O’Reilly online learning.

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