Chapter 2

Programming in the Small
Variables, Input/Output, Control Statements

ON A BASIC LEVEL (the level of machine language), a computer can perform only very simple operations. A computer performs complex tasks by stringing together large numbers of such operations. Such tasks must be "scripted" in complete and perfect detail by programs. Creating complex programs will never be really easy, but the difficulty can be handled to some extent by giving the program a clear overall structure. The design of the overall structure of a program is what I call "programming in the large."

Programming in the small, which is sometimes called coding, would then refer to filling in the details of that design. The details are the explicit, step-by-step instructions for performing fairly small-scale tasks. When you do coding, you are working fairly "close to the machine," with some of the same concepts that you might use in machine language: memory locations, arithmetic operations, loops and decisions. In a high-level language such as Java, you get to work with these concepts on a level several steps above machine language. However, you still have to worry about getting all the details exactly right.

This chapter examines the facilities for "programming in the small" in the Java programming language.

Sections in Chapter 2:

  1. The Basic Java Application
  2. Variables and the Primitive Types
  3. Loops and Branches
  4. The Console Class
  5. Algorithm Development
  6. Details of Expressions
  7. Details of Control Statements
  8. Details of Strings

[ First Section | Next Chapter | Previous Chapter | Main Index ]