CHAPTER 6 — Small Java Programs

Classic programmed-learning exercises, refreshed for modern Java and presented in the current MrStyner.com portfolio style.

Modern Java noteThis archive has been refreshed for Java 25 LTS. Core language concepts remain useful, while outdated setup instructions and browser-era Java are labeled or replaced. Java 26 is the current feature release; Java 25 is used here as the stable teaching baseline.

revised: 01/18/99, 01/17/00, 05/26/02, 07/16/03, 01/10/06

CHAPTER 6 — Small Java Programs

The previous chapter discussed the mechanics of creating and running a Java program. This chapter is an overview of Java using the example program from that chapter.

Chapter Topics:

  • Small example programs
  • Names for source files and class files
  • Syntax errors
  • Bugs
  • The Edit, Compile, and Run cycle
  • Matching braces
  • Neat indenting

QUESTION 1:

(Review:) What role in Java programming does each of the following files play?

  • Source code file
  • Bytecode file