Web hosting comparison - Table of Contents xiii Chapter 5: Controlling Program
Friday, August 31st, 2007Table of Contents xiii Chapter 5: Controlling Program Flow with Decision-Making Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .101 Making Decisions (Java if Statements)………………………………………………102 Guess the number ……………………………………………………………………102 She controlled keystrokes from the keyboard…………………………..103 Creating randomness……………………………………………………………….104 The if statement……………………………………………………………………….105 The double equal sign ……………………………………………………………..106 Brace yourself………………………………………………………………………….107 Indenting if statements in your code………………………………………..107 Elseless in Ifrica ……………………………………………………………………….108 Forming Conditions with Comparisons and Logical Operators………….109 Comparing numbers; comparing characters…………………………….109 Comparing objects …………………………………………………………………..110 Importing everything in one fell swoop ……………………………………113 Java s logical operators ……………………………………………………………113 Building a Nest………………………………………………………………………………….115 Choosing among Many Alternatives (Java switch Statements) ………….116 Your basic switch statement…………………………………………………….117 To break or not to break…………………………………………………………..121 Chapter 6: Controlling Program Flow with Loops . . . . . . . . . . . . . . . .123 Repeating Instructions Over and Over Again (Java while Statements) …………………………………………………………………………………..124 Repeating a Certain Number of Times (Java for Statements) …………….127 The anatomy of a for statement ……………………………………………….128 The world premiere of Al s All Wet ………………………………………..130 Repeating Until You Get What You Want (Java do Statements)………….131 Reading a single character……………………………………………………….134 File handling in Java…………………………………………………………………135 Variable declarations and blocks ……………………………………………..135 Loops Made Painless ………………………………………………………………………..136 Don t need no stinking counters ………………………………………………136 Grouping things together …………………………………………………………138 Anatomy of an enhanced for loop…………………………………………….139 Part III: Working with the Big Picture: Object-Oriented Programming ………………………………143 Chapter 7: Thinking in Terms of Classes and Objects . . . . . . . . . . . .145 Defining a Class (What It Means to Be an Account) …………………………..145 Declaring variables and creating objects………………………………….148 Initializing a variable………………………………………………………………..150 Using variables ………………………………………………………………………..150
Here java web hosting you will find professional-grade java web hosting at affordable prices.