Page 6 - Introduction to Programming with Java: A Problem Solving Approach
P. 6
0.0 Last A-Head v
Contents
Preface ix Project Summary
1
xxi
CHAPTER 3 Java Basics 56
CHAPTER
3.1. Introduction 57
3.2. “I Have a Dream” Program 57 3.3. Comments and Readability 58 3.4. The Class Heading 60
3.5. The main Method’s Heading 3.6. Braces 61
3.7. System.out.println 62 3.8. Compilation and Execution 63 3.9. Identifiers 64
3.10. Variables 65
3.11. Assignment Statements 66 3.12. Initialization Statements 68
Introduction to Computers and Programming 1
60
1.1. Introduction 1
1.2. Hardware Terminology
1.3. Program Development
1.4. Source Code 10
1.5. Compiling Source Code into
Object Code 12
1.6. Portability 12
1.7. Emergence of Java 14
1.8. First Program—Hello World
1.9. GUI Track: Hello World
(Optional) 20
2
Algorithms and Design
CHAPTER
2 9
3.13. Numeric Data Types—int, long, float, Apago PDF Enhancer
15
double 69 3.14. Constants 71
3.15. Arithmetic Operators 74
3.16. Expression Evaluation and Operator
Precedence 76
3.17. More Operators: Increment, Decrement, and
Compound Assignment 78 3.18. Tracing 80
3.19. Type Casting 80
3.20. char Type and Escape Sequences 83 3.21. Primitive Variables Versus Reference
Variables 85 3.22. Strings 86
3.23. Input—the Scanner Class 90 3.24. GUI Track: Input and Output with
JOptionPane (Optional) 95
4
Control Statements 106
4.1. Introduction 107
4.2. Conditions and Boolean Values 107 4.3. if Statements 108
4.4. && Logical Operator 111
2.1. Introduction 25
2.2. Output 26
2.3. Variables 27
2.4. Operators and Assignment
Statements 28
2.5. Input 29
2.6. Flow of Control and Flowcharts
2.7. if Statements 31
2.8. Loops 36
2.9. Loop Termination Techniques
2.10. NestedLooping 41
2.11. Tracing 42
2.12. Other Pseudocode Formats and
30
38
CHAPTER
25
Applications 46
2.13. Problem Solving: Asset Management
(Optional) 48
v