Section 2.5 Another Application: Adding Integers

• An import declaration (p. 46) helps the compiler locate a class that’s used in a program.

• Java’s rich set of predefined classes are grouped into packages (p. 45)—named groups of classes. These are referred to as the Java class library (p. 46), or the Java Application Programming Interface (Java API).

• A variable (p. 46) is a location in the computer’s memory where a value can be stored for use later in a program. All variables must be declared with a name and a type before they can be used.

• A variable’s name enables the program to access the variable’s value in memory.

• A Scanner (package java.util; p. 47) enables a program to read data that the program will use. Before a Scanner can be ...

Get Java™ How To Program (Early Objects), Tenth 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.