- Page 1: Java with BlueJ Part I Ron McFadyen
- Page 5 and 6: Contents 1 Introduction 9 1.1 Java,
- Page 7 and 8: Preface This book is Part I of a tw
- Page 9 and 10: Chapter 1 Introduction This book is
- Page 11 and 12: 1.2. THE JAVA COMPILER AND THE JAVA
- Page 13 and 14: 1.4. A FIRST PROGRAM 13 1.4 A First
- Page 15 and 16: 1.5. USING BLUEJ TO RUN HELLOWORLD
- Page 17 and 18: 1.5. USING BLUEJ TO RUN HELLOWORLD
- Page 19 and 20: Chapter 2 Basics This chapter cover
- Page 21 and 22: 2.2. VARIABLES 21 Listing 2.1: Usin
- Page 23 and 24: 2.3. PRIMITIVE DATA TYPES 23 Exerci
- Page 25 and 26: 2.3. PRIMITIVE DATA TYPES 25 Defaul
- Page 27 and 28: 2.3. PRIMITIVE DATA TYPES 27 14 Sys
- Page 29 and 30: 2.3. PRIMITIVE DATA TYPES 29 2.3.3
- Page 31 and 32: 2.3. PRIMITIVE DATA TYPES 31 Exampl
- Page 33 and 34: 2.3. PRIMITIVE DATA TYPES 33 10 int
- Page 35 and 36: 2.3. PRIMITIVE DATA TYPES 35 where
- Page 37 and 38: 2.3. PRIMITIVE DATA TYPES 37 to kno
- Page 39 and 40: 2.3. PRIMITIVE DATA TYPES 39 9 // D
- Page 41 and 42: 2.3. PRIMITIVE DATA TYPES 41 use in
- Page 43 and 44: 2.4. OPERATORS 43 2.4 Operators We
- Page 45 and 46: 2.4. OPERATORS 45 odd statement to
- Page 47 and 48: 2.5. THE STRING CLASS 47 Since text
- Page 49 and 50: 2.5. THE STRING CLASS 49 name of th
- Page 51 and 52: 2.5. THE STRING CLASS 51 Example, d
- Page 53 and 54:
2.5. THE STRING CLASS 53 Exercises
- Page 55 and 56:
2.6. OUTPUT 55 12 // Each time prin
- Page 57 and 58:
2.6. OUTPUT 57 Test your program wi
- Page 59 and 60:
2.6. OUTPUT 59 • Lines 14 and 15
- Page 61 and 62:
2.7. INPUT 61 2.7 Input We examine
- Page 63 and 64:
2.7. INPUT 63 Figure 2.8: Terminal
- Page 65 and 66:
2.7. INPUT 65 2.7.2 The JOptionPane
- Page 67 and 68:
Chapter 3 Control Structures Progra
- Page 69 and 70:
3.2. WHILE 69 A logical expression
- Page 71 and 72:
3.2. WHILE 71 Figure 3.1: Output fr
- Page 73 and 74:
3.2. WHILE 73 An example of output
- Page 75 and 76:
3.2. WHILE 75 25 } 26 } Figure 3.2:
- Page 77 and 78:
3.2. WHILE 77 Autoincrement Because
- Page 79 and 80:
3.3. IF 79 Example 1 Suppose one ne
- Page 81 and 82:
3.3. IF 81 Exercises 15. Write a pr
- Page 83 and 84:
3.3. IF 83 9 { 10 public static voi
- Page 85 and 86:
3.3. IF 85 Listing 3.6: Using an if
- Page 87 and 88:
3.3. IF 87 the indentation. Each of
- Page 89 and 90:
3.4. FOR 89 3.4 for The for stateme
- Page 91 and 92:
3.4. FOR 91 Example 1 Below we use
- Page 93 and 94:
3.4. FOR 93 Table 3.1: Process indi
- Page 95 and 96:
3.4. FOR 95 Example 4 The program i
- Page 97 and 98:
3.4. FOR 97 Example 5 In this examp
- Page 99 and 100:
3.4. FOR 99 . . . Step 2, formattin
- Page 101 and 102:
3.4. FOR 101 Exercises 20. Modify t
- Page 103 and 104:
3.4. FOR 103 34. Modify the previou
- Page 105 and 106:
3.5. DO ...WHILE 105 Example 1 Let
- Page 107 and 108:
3.5. DO ...WHILE 107 Listing 3.16:
- Page 109 and 110:
3.6. SWITCH 109 3.6 switch The swit
- Page 111 and 112:
3.6. SWITCH 111 Example 1 Previousl
- Page 113 and 114:
3.6. SWITCH 113 Exercises 39. Write
- Page 115 and 116:
Chapter 4 Classes in the Java Class
- Page 117 and 118:
4.1. RANDOM 117 Example 2 Consider
- Page 119 and 120:
4.1. RANDOM 119 Exercises 1. Modify
- Page 121 and 122:
4.2. CHARACTER 121 Example 1 Ifthed
- Page 123 and 124:
4.2. CHARACTER 123 Example 2 The Ch
- Page 125 and 126:
4.2. CHARACTER 125 Below is the out
- Page 127 and 128:
4.3. SCANNER 127 4.3 Scanner Previo
- Page 129 and 130:
4.3. SCANNER 129 Note that the abov
- Page 131 and 132:
4.3. SCANNER 131
- Page 133 and 134:
4.3. SCANNER 133 Exercises 11. Modi
- Page 135 and 136:
4.4. MATH 135 The Math Class Fields
- Page 137 and 138:
4.5. INTEGER 137 4.5 Integer The In
- Page 139 and 140:
4.5. INTEGER 139 Listing 4.9: Using
- Page 141 and 142:
Chapter 5 ArrayLists There are seve
- Page 143 and 144:
143 The enhanced for Thereisavariat
- Page 145 and 146:
145 Example 2 The contains() method
- Page 147 and 148:
147 20 people.add(new Random()); 21
- Page 149 and 150:
Chapter 6 One-Dimensional Arrays Th
- Page 151 and 152:
6.1. INITIALIZING ARRAYS 151 6.1 In
- Page 153 and 154:
6.3. THE ENHANCED FOR 153 6.3 The e
- Page 155 and 156:
6.4. PASSING STRING VALUES INTO MAI
- Page 157 and 158:
6.5. PARALLEL ARRAYS 157 18 } This
- Page 159 and 160:
6.6. PARTIALLY FILLED ARRAYS 159 Th
- Page 161 and 162:
6.7. ARRAY UTILITIES IN JAVA CLASS
- Page 163 and 164:
6.7. ARRAY UTILITIES IN JAVA CLASS
- Page 165 and 166:
Chapter 7 Designing Java Classes Up
- Page 167 and 168:
7.1. USING MULTIPLE CLASSES 167 7.1
- Page 169 and 170:
7.2. FIELDS 169 Figure 7.2: Class d
- Page 171 and 172:
7.3. METHODS 171 7.3 Methods A meth
- Page 173 and 174:
7.3. METHODS 173 Calling the other
- Page 175 and 176:
7.3. METHODS 175 void methods Somet
- Page 177 and 178:
7.4. CONSTRUCTORS 177 10 private St
- Page 179 and 180:
7.4. CONSTRUCTORS 179 Using constru
- Page 181 and 182:
7.5. VISIBILITY SPECIFICATIONS: PUB
- Page 183 and 184:
7.7. ASSOCIATIONS 183 7.7 Associati
- Page 185 and 186:
7.7. ASSOCIATIONS 185 Notice that t
- Page 187 and 188:
7.7. ASSOCIATIONS 187 Now reconside
- Page 189 and 190:
7.8. REUSING CODE 189 24 } The outp
- Page 191 and 192:
7.9. PARAMETER LISTS AND ARGUMENTS
- Page 193 and 194:
7.10. VARARGS: A VARIABLE NUMBER OF
- Page 195 and 196:
7.11. CODE LISTINGS: STUDENT, SUBJE
- Page 197 and 198:
7.11. CODE LISTINGS: STUDENT, SUBJE
- Page 199 and 200:
7.11. CODE LISTINGS: STUDENT, SUBJE
- Page 201 and 202:
7.11. CODE LISTINGS: STUDENT, SUBJE
- Page 203 and 204:
Chapter 8 A Brief Introduction to G
- Page 205 and 206:
8.1. BRIEF INTRODUCTION TO SIMPLE G
- Page 207 and 208:
8.1. BRIEF INTRODUCTION TO SIMPLE G
- Page 209 and 210:
8.1. BRIEF INTRODUCTION TO SIMPLE G
- Page 211 and 212:
8.1. BRIEF INTRODUCTION TO SIMPLE G
- Page 213 and 214:
8.1. BRIEF INTRODUCTION TO SIMPLE G
- Page 215 and 216:
8.1. BRIEF INTRODUCTION TO SIMPLE G
- Page 217 and 218:
8.1. BRIEF INTRODUCTION TO SIMPLE G
- Page 219 and 220:
8.1. BRIEF INTRODUCTION TO SIMPLE G
- Page 221 and 222:
8.1. BRIEF INTRODUCTION TO SIMPLE G
- Page 223:
Bibliography [1] http://publication