Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


Share this Page URL
Help

52 Chapter 2 Introduction to Java Applications The parentheses around the expression number1 + number2 are not required--they're in- cluded to emphasize that the value of the entire expression is output in the position of the %d format specifier. Java API Documentation For each new Java API class we use, we indicate the package in which it's located. This information helps you locate descriptions of each package and class in the Java API docu- mentation. A web-based version of this documentation can be found at download.oracle.com/javase/6/docs/api/ You can download it from www.oracle.com/technetwork/java/javase/downloads/index.html Appendix E shows how to use this documentation. 2.6 Memory Concepts Variable names such as number1 , number2 and sum actually correspond to locations in the computer's memory. Every variable has a name, a type, a size (in bytes) and a value. In the addition program of Fig. 2.7, when the following statement (line 18) executes: number1 = input.nextInt(); // read first number from user