Chapter 1. Introduction

CHAPTER GOALS

  • To understand the activity of programming

  • To learn about the architecture of computers

  • To learn about machine code and high-level programming languages

  • To become familiar with the structure of simple Java programs

  • To compile and run your first Java program

  • To recognize compile-time and run-time errors

  • To write pseudocode for simple algorithms

The purpose of this chapter is to familiarize you with the concepts of programming and program development. It reviews the architecture of a computer and discusses the difference between machine code and high-level programming languages. You will see how to compile and run your first Java program, and how to diagnose errors that may occur when a program is compiled or executed. Finally, you will learn how to formulate simple algorithms using pseudocode notation.

What Is Programming?

You have probably used a computer for work or fun. Many people use computers for everyday tasks such as balancing a checkbook or writing a term paper. Computers are good for such tasks. They can handle repetitive chores, such as totaling up numbers or placing words on a page, without getting bored or exhausted. Computers also make good game machines because they can play sequences of sounds and pictures, involving the human user in the process.

The flexibility of a computer is quite an amazing phenomenon. The same machine can balance your checkbook, print your term paper, and play a game. In contrast, other machines carry out a much narrower ...

Get Big Java, 4th 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.