Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
As a programmer, you probably have a methodology/process/approach to writing code. Well, so do we. Our sequence is designed to help you see (and learn) what we’re thinking as we work through coding a class. It isn’t necessarily the way we (or you) write code in the Real World. In the Real World, of course, you’ll follow the approach your personal preferences, project, or employer dictate. We, however, can do pretty much whatever we want. And when we create a Java class as a “learning experience”, we usually do it like this:
Figure out what the class is supposed to do.
List the instance variables and methods.
Write prepcode for the methods. (You’ll see this in just a moment.)
Write test code for the methods.
Implement the class.