When Programs Don’t Work

Many new programmers become discouraged when they start to test their programs. Errors appear everywhere. Some of these are syntax errors, which are identified by the computer as it looks at the program and becomes confused by what you wrote. Other errors are logic errors, which are noticed only by the programmer as the program is being tested (and might be overlooked entirely). Logic errors sneak by the computer unnoticed, but they often cause it to do something unintended.

As you begin writing your own programs, you become well acquainted with errors. They’re a natural part of the process. Programming errors are called bugs, a term that dates back a century or more to describe errors in technical devices. The process ...

Get Sams Teach Yourself Java™ in 24 Hours, Sixth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.