Chapter 2. Writing Your First Program

<feature><title></title>

WHAT YOU’LL LEARN IN THIS HOUR:

  • Entering a program into a word processor

  • Naming a Java program with the class statement

  • Organizing a program with bracket marks

  • Storing information in a variable

  • Displaying the information stored in a variable

  • Saving a program

  • Compiling a program

  • Running a program

  • Fixing errors

</feature>

As you learned during Hour 1, “Becoming a Programmer,” a computer program is a set of instructions that tells a computer what to do. These instructions are given to a computer using a programming language.

During this hour, you create your first Java program by entering it using a word processor. When that’s done, you save the program, compile it, and test it out.

What You Need ...

Get Sams Teach Yourself Java™ in 24 Hours, Fifth 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.