ABSTRACT

The chapter introduces the basic structure of a Java program. The main method is where the program starts executing. For now, we will use the console for reading and displaying data. Most programs will read data from the console and save it in main memory. The memory in a Java program is accessed through variables. These variables can be used to store integers, real numbers, and strings, among others. The chapter shows how to read data from the keyboard, save it in variables, manipulate the data, and then display the result. The chapter also shows how the keywords if and switch can be used to interrupt the sequential execution of a program.