JAVA FOR STUDENTS

5TH EDITION

DOUGLAS BELL AND MIKE PARR

WHY WE DID WHAT WE DID

About this book

Previous Editions

More books by us

For Instructors(ppt etc.)

For Students

Contents

Preface (Word)

Updates, errors

Sample Chapters

Download Code

We tried to bear in mind that this is a first level book. We have therefore erred on the side of avoiding complexities.

This is a book about a language, obviously, but also about how to do programming in general. Hence the plan to avoid some of the details of the language. Plus we suspect that there is sufficient challenge in learning what we have included in the book - which we see as the important ideas in programming and in programming languages.

A number of reviewers looked at the book before it was published and made many eminently sensible and constructive suggestions. We thank them for their efforts in improving the book. We considered seriously, but didn't adopt all their suggestions. Some of the rationale is given below.

We hope you find the book useful and maybe even enjoyable.

Chapter 3. Introductory Graphics

Our vision is that students would enjoy using graphics because of its immediate visual appeal and that graphics would be the vehicle for understanding a number of programming ideas.

In Java, there are two ways to do graphics:

1. a simple way, that we use in the book
2. the proper way, involving paintComponent and repaint. We found that students had trouble with the use of these methods (intermingled with events) so we do not use them.

Chapter 4. Variables and Calculations

We have restricted ourselves to just two of the shortcut operators, ++ and --. These are the most useful, particularly inside loops. We feel that the others are rarely used and can be more trouble than they are worth (to the novice).

Chapter 7. Selection

We decided, for simplicity, to cover only the && || and ! operators. It seems to us that to introduce the others in a first level book is just too much.

Chapter 12. Array Lists

Readers can skip this chapter. But it is there to provide a gentle introduction to data structures. In our experience, students have difficulty in understanding arrays and array lists because they are invisible. But list boxes are visible. See this article for more of the argument.

You might care to use this material instead of the stuff on arrays. It also uses the 1.5 generics and the enhanced 'for' where appropriate.

Chapter 17. Files and Console Applications

The whole theme of the book is programs with a GUI. But we felt we should not neglect console programs. Some programs take the other approach and are all about console programs.

Chapter 23 and 25. Interfaces and polymorphism

Some reviewers thought we should introduce these topics earlier - at the same time as the topic of inheritance, or immediately afterwards. But we think that these are rather more advanced topics and that is why we put them at the end. We suspect that readers have enough on to understand the ideas of writing a class and then the idea of inheritance without having to immediately address the concepts of interfaces and polymorphism