Java How To Program 8th Edition (Late Objects) - Chapter Outlines
Select a chapter: 1 2 3 4 5 6 7 8 9 10 11 14 16 17
1 Introduction to Computers, the Internet and the Web I
1.1 Introduction 2
1.2 Computers: Hardware and Software 3
1.3 Computer Organization 4
1.4 Early Operating Systems 5
1.5 Personal, Distributed and Client/Server Computing 6
1.6 The Internet and the World Wide Web 6
1.7 Machine Languages, Assembly Languages and High-Level Languages 7
1.8 History of C and C++ 8
1.9 History of Java 8
1.10 Java Class Libraries 9
1.11 Fortran, COBOL, Pascal and Ada 10
1.12 BASIC, Visual Basic, Visual C++, C# and .NET 11
1.13 Typical Java Development Environment 11
1.14 Notes about Java and Java How to Program 14
1.15 Test-Driving a Java Application 15
1.16 Introduction to Object Technology and the UML 20
1.17 Web 2.0 24
1.18 Software Technologies 25
1.19 Wrap-Up 26
1.20 Web Resources 26
Java How To Program 8th Edition (Late Objects) - Chapter Outlines
2 Introduction to Java Applications 37
2.1 Introduction 38
2.2 Our First Program in Java: Printing a Line of Text 38
2.3 Modifying Our First Java Program 44
2.4 Displaying Text with printf 46
2.5 Another Application: Adding Integers 47
2.6 Memory Concepts 52
2.7 Arithmetic 53
2.8 Decision Making: Equality and Relational Operators 56
2.9 (Optional) GUI and Graphics Case Study: Using Dialog Boxes 60
2.10 Wrap-Up 63
Top of the Document
Java How To Program 8th Edition (Late Objects) - Chapter Outlines
3 Control Statements: Part I 75
3.1 Introduction 76
3.2 Algorithms 76
3.3 Pseudocode 77
3.4 Control Structures 77
3.5 if Single-Selection Statement 79
3.6 if...else Double-Selection Statement 80
3.7 while Repetition Statement 85
3.8 Formulating Algorithms: Counter-Controlled Repetition 86
3.9 Formulating Algorithms: Sentinel-Controlled Repetition 89
3.10 Formulating Algorithms: Nested Control Statements 97
3.11 Compound Assignment Operators 101
3.12 Increment and Decrement Operators 102
3.13 Primitive Types 105
3.14 (Optional) GUI and Graphics Case Study: Creating Simple Drawings 105
3.15 Wrap-Up 109
Top of the Document
Java How To Program 8th Edition (Late Objects) - Chapter Outlines
4 Control Statements: Part 2 124
4.1 Introduction 125
4.2 Essentials of Counter-Controlled Repetition 125
4.3 for Repetition Statement 127
4.4 Examples Using the for Statement 130
4.5 do...while Repetition Statement 135
4.6 switch Multiple-Selection Statement 137
4.7 break and continue Statements 142
4.8 Logical Operators 144
4.9 Structured Programming Summary 150
4.10 (Optional) GUI and Graphics Case Study: Drawing Rectangles and Ovals 155
4.11 Wrap-Up 157
Top of the Document
Java How To Program 8th Edition (Late Objects) - Chapter Outlines
5 Methods 167
5.1 Introduction 168
5.2 Program Modules in Java 168
5.3 static Methods, static Fields and Class Math 170
5.4 Declaring Methods 172
Notes on Declaring and Using Methods 176
5.6 Method-Call Stack and Activation Records 177
5.7 Argument Promotion and Casting 178
5.8 Java API Packages 179
5.9 Case Study: Random-Number Generation 181
5.9.1 Generalized Scaling and Shifting of Random Numbers 185
5.9.2 Random-Number Repeatability for Testing and Debugging 185
5.10 Case Study: A Game of Chance; Introducing Enumerations 186
5.11 Scope of Declarations 190
5.12 Method Overloading 192
5.13 (Optional) GUI and Graphics Case Study: Colors and Filled Shapes 195
5.14 Wrap-Up 198
Top of the Document
Java How To Program 8th Edition (Late Objects) - Chapter Outlines
6 Arrays; Introducing Strings and Files 212
6.1 Introduction 213
6.2 Primitive Types vs. Reference Types 214
6.3 Arrays 214
6.4 Declaring array reference variables, and Creating Arrays 216
6.5 Examples Using Arrays 217
6.6 Enhanced for Statement 226
6.7 Passing Arrays to Methods 227
6.8 Multidimensional Arrays 230
6.9 Case Study: Summarizing Student Exam Grades Using a Two-Dimensional Array 233
6.10 Variable-Length Argument Lists 238
6.11 Using Command-Line Arguments 240
6.12 Class Arrays (binary search, sort, copy) 241
6.13 Introduction to Collections and Class ArrayList 244
6.14 Fundamentals of Characters and Strings 247
6.15 Class String 248
6.15.1 Initializing Strings 248
6.15.2 String Methods length, charAt and getChars 249
6.15.3 Comparing Strings 250
6.15.4 Locating Characters and Substrings in Strings 255
6.15.5 Extracting Substrings from Strings 256
6.15-6 Concatenating Strings 257
6.15.7 Miscellaneous String Methods 258
6.15.8 String Method valueOf 259
6.16 Introduction to File Processing 261
6.17 Data Hierarchy 261
6.18 Files and Streams 263
6.19 Sequential-Access Text Files 264
6.19.1 Creating a Sequential-Access Text File 265
6.19.2 Reading Data from a Sequential-Access Text File 268
6.20 (Optional) GUI and Graphics Case Study: Drawing Arcs 270
6.21 Wrap-Up 273
Top of the Document
Java How To Program 8th Edition (Late Objects) - Chapter Outlines
7 Introduction to Classes and Objects 298
7.1 Introduction 299
7.2 Classes, Objects, Methods, and Instance Variables (aka fields) 299
7.3 Declaring a Class and Instantiating an Object of that Class 300
variable
local
parameter list
method body
for loop
global
instance variable (field)
class variable (aka static variable)
7.4 Initializing Objects with Constructors [ new, initializer list ] 308
7.5 Case Study: Account Balances; Validating Constructor Arguments 311
7.6 Case Study: Card Shuffling and Dealing Simulation 315
7.7 Wrap-Up 319
Top of the Document
Java How To Program 8th Edition (Late Objects) - Chapter Outlines
8 Classes and Objects: A Deeper Look 324
8.1 Introduction 325
8.2 Time Class Case Study 325
8.3 Controlling Access to Members 329
8.4 Referring to the Current Object's Members with the this Reference 330
8.5 Time Class Case Study: Overloaded Constructors 333
8.6 Default and No-Argument Constructors 338
8.7 Notes on Set and Get Methods 339
8.8 Composition 340
8.9 Enumerations 343
8.10 Garbage Collection [System.gc( )], null value, and Method finalize 346
8.11 static Class Members 346
8.12 static Import 350
8.13 final Instance Variables 351
8.14 Time Class Case Study: Creating Packages 354
8.15 Package Access 359
8.16 (Optional) GUI and Graphics Case Study: Using Objects with Graphics 360
8.17 Wrap-Up 364
Top of the Document
Java How To Program 8th Edition (Late Objects) - Chapter Outlines
9 Object-Oriented Programming: Inheritance 373
9.1 Introduction 374
9.2 Superclasses and Subclasses, extends keyword 375
9.3 protected Members 377
9.4 Relationship between Superclasses and Subclasses “is-a” 378
9.4.1 Creating and Using a CommissionEmployeeClass 378
9.4.2 Creating and Using a BasePlusCommissionEmployee Class 383
Overriding an inherited method
9.4.3 Creating a CommissionEmployee / BasePlusCommissionEmployee Inheritance Hierarchy 388
Using a superclass method this.( )
9.4.4 CommissionEmployee / BasePlusCommissionEmployee Inheritance Hierarchy
Using protected Instance Variables 391
9.4.5 CommissionEmployee / BasePlusCommissionEmployee Inheritance Hierarchy
Using private Instance Variables 394
9.5 Constructors in Subclasses super( ), this( ) 398
9.6 Software Engineering with Inheritance 399
9.7 Object Class toString( ) [ object state ] finalize( ) [ ~ destructor ] 400
9.8 (Optional) GUI and Graphics Case Study: Displaying Text and Images Using Labels 402
9.9 Wrap-Up 404
Top of the Document
Java How To Program 8th Edition (Late Objects) - Chapter Outlines
10 Object-Oriented Programming: Polymorphism 408
10.1 Introduction superclass reference to a subclass object 409
10.2 Polymorphism Examples 411
10.3 Demonstrating Polymorphic Behavior 412
10.4 Abstract Classes and Methods 414
10.5 Case Study: Payroll System Using Polymorphism 416
10.5.1 Abstract Superclass Employee 417
10.5.2 Concrete Subclass SalariedEmployee 420
10.5.3 Concrete Subclass HourlyEmployee 422
10.5.4 Concrete Subclass CommissionEmployee 423
10.5.5 Indirect Concrete Subclass BasePlusCommissionEmployee 425
10.5.6 Polymorphic Processing, Operator instanceof and Downcasting 426
10.5.7 Summary of the Allowed Assignments Between Superclass and Subclass Variables 431
10.6 final Methods and Classes 431
10.7 Case Study: Creating and Using Interfaces 432
10.7.1 Developing a Payable Hierarchy 434
10.7.2 Interface Payable 435
10.7.3 Class Invoice 435
10.7.4 Modifying Class Employee to Implement Interface Payable implements keyword 438
10.7.5 Modifying Class SalariedEmployee for Use in the Payable Hierarchy 439
10.7.6 Using Interface Payable to Process Invoices and Employees Polymorphically 441
10.7.7 Common Interfaces of the Java API 443
10.8 (Optional) GUI and Graphics Case Study: Drawing with Polymorphism 444
10.9 Wrap-Up 446
Top of the Document
Java How To Program 8th Edition (Late Objects) - Chapter Outlines
11 Exception Handling 451
11.1 Introduction 452
11.2 Error-Handling Overview (try, catch, finally blocks) 453
11.3 Example: Divide by Zero without Exception Handling 453
11.4 Example: Handling ArithmeticExceptions and InputMismatchExceptions 456
11.5 When to Use Exception Handling 461
11.6 Java Exception Hierarchy 461
11.7 finally Block 464
11.8 Stack Unwinding 469
11.9 printStackTrace, getStackTrace and getMessage 470
11.10 Chained Exceptions 473
11.11 Declaring New Exception Types 475
11.12 Preconditions and Postconditions 476
11.13 Assertions 476
11.14 Wrap-Up 478
Top of the Document
Java How To Program 8th Edition (Late Objects) - Chapter Outlines
14 GUI Components: Part I 563
14.1 Introduction 564
14.2 Java's New Nimbus Look-and-Feel 565
14.3 Simple GUI-Based Input/Output with JOptionPane 566
14.4 Overview of Swing Components 569
14.5 Displaying Text and Images in a Window 571
14.6 Text Fields and an Introduction to Event Handling with Nested Classes 576
14.7 Common GUI Event Types and Listener Interfaces 582
14.8 How Event Handling Works 584
14.9 JButton 586
14.10 Buttons That Maintain State 589
14.10.1 JCheckBox 589
14.10.2 JRadioButton 592
14.11 JComboBox and Using an Anonymous Inner Class for Event Handling 595
14.12 JList 599
14.13 Multiple-Selection Lists 601
14.14 Mouse Event Handling 604
14.15 Adapter Classes 608
14.16 JPanel Subclass for Drawing with the Mouse 612
14.17 Key Event Handling 615
14.18 Introduction to Layout Managers 618
14.18.1 FlowLayout 620
14.18.2 BorderLayout 623
14.18.3 GridLayout 626
14.19 Using Panels to Manage More Complex Layouts 628
14.20 JTextArea 630
14.21 Wrap-Up 632
Top of the Document
Java How To Program 8th Edition (Late Objects) - Chapter Outlines
16 Strings, Characters and Regular Expressions 689
16.1 Introduction 690
16.2 Class St ringBuilder 690
16.2.1 StringBuilder Constructors 691
16.2.2 StringBuilder Methods length, capacity, setLength and ensureCapacity 691
16.2.3 StringBuilder Methods charAt, setCharAt, getChars and reverse 693
16.2.4 StringBuilder append Methods 694
16.2.5 StringBuilder Insertion and Deletion Methods 696
16.3 Class Character 697
16.4 Tokenizing Strings 701
16.5 Regular Expressions, Class Pattern and Class Matcher 703
16.6 Wrap-Up 711
Top of the Document
Java How To Program 8th Edition (Late Objects) - Chapter Outlines
17 Files, Streams and Object Serialization 719
17.1 Introduction 720
17.2 The java. io Package 720
17.3 Class File 721
17.4 Case Study: A Credit-Inquiry Program 725
17.4.1 Class AccountRecord 725
17.4.2 Credit-Inquiry Program 727
17.4.3 Updating Sequential-Access Files 733
17.5 Object Serialization 733
17.5-1 Creating a Sequential-Access File Using Object Serialization 734
17.5.2 Reading and Deserializing Data from a Sequential-Access File 740
17.6 Additional java. io Classes 743
17.6.1 Interfaces and Classes for Byte-Based Input and Output 743
17.6.2 Interfaces and Classes for Character-Based Input and Output 744
17.7 Opening Files with DFileChooser 745
17.8 Wrap-Up 748
Top of the Document