An edition of Objects first with Java (2002)

Objects first with Java

a practical introduction using BlueJ

4th ed.
  • 1.0 (1 rating)
  • 58 Want to read
  • 5 Currently reading

My Reading Lists:

Create a new list

  • 1.0 (1 rating)
  • 58 Want to read
  • 5 Currently reading

Buy this book

Last edited by Drini
September 14, 2025 | History
An edition of Objects first with Java (2002)

Objects first with Java

a practical introduction using BlueJ

4th ed.
  • 1.0 (1 rating)
  • 58 Want to read
  • 5 Currently reading

This introductory programming textbook integrates BlueJ with Java. It provides a thorough treatment of object-oriented principles.

Publish Date
Language
English
Pages
560

Buy this book

Previews available in: English

Edition Availability
Cover of: Objects first with Java
Objects first with Java: a practical introduction using BlueJ
2012, Pearson
in English - 5th ed.
Cover of: Objects first with Java
Objects first with Java: a practical introduction using BlueJ
2009, Pearson Prentice Hall
in English - 4th ed.
Cover of: Objects First With Java
Objects First With Java: A Practical Introduction Using BlueJ (3rd Edition)
June 5, 2006, Prentice Hall
in English

Add another edition?

Book Details


Table of Contents

Foreword
Page xviii
Preface To The Instructor
Page xix
Guided Tour
Page xxvii
List Of Projects Discussed In Detail In This Book
Page xxix
Acknowledgments
Page xxxi
Part 1. Foundations Of Object Orientation
Page 1
Chapter 1. Objects And Classes
Page 3
1.1. Objects And Classes
Page 3
1.2. Creating Objects
Page 4
1.3. Calling Methods
Page 5
1.4. Parameters
Page 6
1.5. Data Types
Page 7
1.6. Multiple Instances
Page 8
1.7. State
Page 8
1.8. What Is In An Object?
Page 9
1.9. Object Interaction
Page 10
1.10. Source Code
Page 11
1.11. Another Example
Page 13
1.12. Return Values
Page 13
1.13. Objects As Parameters
Page 14
1.14. Summary
Page 15
Chapter 2. Understanding Class Definitions
Page 18
2.1. Ticket Machines
Page 18
2.1.1. Exploring The Behavior Of A Naïve Ticket Machine
Page 19
2.2. Examining A Class Definition
Page 20
2.3. Fields, Constructors, And Methods
Page 22
2.3.1. Fields
Page 24
2.3.2. Constructors
Page 26
2.4. Passing Data Via Parameters
Page 27
2.5. Assignment
Page 29
2.6. Accessor Methods
Page 30
2.7. Mutator Methods
Page 32
2.8. Printing From Methods
Page 34
2.9. Summary Of The Naïve Ticket Machine
Page 36
2.10. Reflecting On The Design Of The Ticket Machine
Page 37
2.11. Making Choices: The Conditional Statement
Page 40
2.12. A Further Conditional-Statement Example
Page 41
2.13. Local Variables
Page 42
2.14. Fields, Parameters, And Local Variables
Page 44
2.15. Summary Of The Better Ticket Machine
Page 45
2.16. Self‑Review Exercises
Page 45
2.17. Reviewing A Familiar Example
Page 47
2.18. Experimenting With Expressions: The Code Pad
Page 50
2.19. Summary
Page 52
Chapter 3. Object Interaction
Page 56
3.1. The Clock Example
Page 56
3.2. Abstraction And Modularization
Page 57
3.3. Abstraction In Software
Page 58
3.4. Modularization In The Clock Example
Page 58
3.5. Implementing The Clock Display
Page 59
3.6. Class Diagrams Versus Object Diagrams
Page 60
3.7. Primitive Types And Object Types
Page 63
3.8. The ClockDisplay Source Code
Page 63
3.8.1. Class NumberDisplay
Page 63
3.8.2. String Concatenation
Page 66
3.8.3. The Modulo Operator
Page 67
3.8.4. Class ClockDisplay
Page 68
3.9. Objects Creating Objects
Page 71
3.10. Multiple Constructors
Page 73
3.11. Method Calls
Page 73
3.11.1. Internal Method Calls
Page 73
3.11.2. External Method Calls
Page 74
3.11.3. Summary Of The Clock Display
Page 75
3.12. Another Example Of Object Interaction
Page 76
3.12.1. The Mail System Example
Page 77
3.12.2. The This Keyword
Page 78
3.13. Using A Debugger
Page 79
3.13.1. Setting Breakpoints
Page 80
3.13.2. Single Stepping
Page 81
3.13.3. Stepping Into Methods
Page 82
3.14. Method Calling Revisited
Page 83
3.15. Summary
Page 84
Chapter 4. Grouping Objects
Page 87
4.1. Grouping Objects In Flexible-Size Collections
Page 87
4.2. A Personal Notebook
Page 88
4.3. A First Look At Library Classes
Page 88
4.3.1. An Example Of Using A Library
Page 89
4.4. Object Structures With Collections
Page 91
4.5. Generic Classes
Page 92
4.6. Numbering Within Collections
Page 93
4.7. Removing An Item From A Collection
Page 94
4.8. Processing A Whole Collection
Page 96
4.8.1. The For-Each Loop
Page 97
4.8.2. The While Loop
Page 99
4.8.3. Iterating Over A Collection
Page 102
4.8.4. Index Access Versus Iterators
Page 103
4.8.5. Removing Elements
Page 104
4.9. Summary Of The Notebook Example
Page 105
4.10. Another Example: An Auction System
Page 106
4.10.1. The Lot Class
Page 106
4.10.2. The Auction Class
Page 108
4.10.3. Anonymous Objects
Page 110
4.10.4. Using Collections
Page 111
4.11. Flexible Collection Summary
Page 113
4.12. Fixed-Size Collections
Page 114
4.12.1. A Log-File Analyzer
Page 114
4.12.2. Declaring Array Variables
Page 117
4.12.3. Creating Array Objects
Page 117
4.12.4. Using Array Objects
Page 119
4.12.5. Analyzing The Log File
Page 119
4.12.6. The For Loop
Page 120
4.12.7. The For Loop And Iterators
Page 122
4.13. Summary
Page 126
Chapter 5. More Sophisticated Behavior
Page 128
5.1. Documentation For Library Classes
Page 129
5.2. The TechSupport System
Page 130
5.2.1. Exploring The TechSupport System
Page 130
5.2.2. Reading The Code
Page 132
5.3. Reading Class Documentation
Page 136
5.3.1. Interfaces Versus Implementation
Page 137
5.3.2. Using Library-Class Methods
Page 138
5.3.3. Checking String Equality
Page 140
5.4. Adding Random Behavior
Page 140
5.4.1. The Random Class
Page 141
5.4.2. Random Numbers With Limited Range
Page 142
5.4.3. Generating Random Responses
Page 143
5.4.4. Reading Documentation For Parameterized Classes
Page 146
5.5. Packages And Import
Page 146
5.6. Using Maps For Associations
Page 147
5.6.1. The Concept Of A Map
Page 148
5.6.2. Using A HashMap
Page 148
5.6.3. Using A Map For The TechSupport System
Page 150
5.7. Using Sets
Page 152
5.8. Dividing Strings
Page 153
5.9. Finishing The TechSupport System
Page 154
5.10. Writing Class Documentation
Page 156
5.10.1. Using Javadoc In BlueJ
Page 157
5.10.2. Elements Of Class Documentation
Page 157
5.11. Public Versus Private
Page 158
5.11.1. Information Hiding
Page 159
5.11.2. Private Methods And Public Fields
Page 160
5.12. Learning About Classes From Their Interfaces
Page 161
5.13. Class Variables And Constants
Page 163
5.13.1. The Static Keyword
Page 164
5.13.2. Constants
Page 165
5.14. Summary
Page 166
Chapter 6. Well-Behaved Objects
Page 169
6.1. Introduction
Page 169
6.2. Testing And Debugging
Page 170
6.3. Unit Testing Within BlueJ
Page 170
6.3.1. Using Inspectors
Page 175
6.3.2. Positive Versus Negative Testing
Page 177
6.4. Test Automation
Page 177
6.4.1. Regression Testing
Page 178
6.4.2. Automated Checking Of Test Results
Page 180
6.4.3. Recording A Test
Page 183
6.4.4. Fixtures
Page 185
6.5. Modularization And Interfaces
Page 186
6.6. A Debugging Scenario
Page 188
6.7. Commenting And Style
Page 188
6.8. Manual Walkthroughs
Page 190
6.8.1. A High-Level Walkthrough
Page 190
6.8.2. Checking State With A Walkthrough
Page 192
6.8.3. Verbal Walkthroughs
Page 194
6.9. Print Statements
Page 195
6.9.1. Turning Debugging Information On Or Off
Page 197
6.10. Choosing A Test Strategy
Page 198
6.11. Debuggers
Page 199
6.12. Putting The Techniques Into Practice
Page 200
6.13. Summary
Page 200
Chapter 7. Designing Classes
Page 201
7.1. Introduction
Page 201
7.2. The World-Of-Zuul Game Example
Page 203
7.3. Introduction To Coupling And Cohesion
Page 205
7.4. Code Duplication
Page 206
7.5. Making Extensions
Page 210
7.5.1. The Task
Page 210
7.5.2. Finding The Relevant Source Code
Page 210
7.6. Coupling
Page 212
7.6.1. Using Encapsulation To Reduce Coupling
Page 213
7.7. Responsibility-Driven Design
Page 217
7.7.1. Responsibilities And Coupling
Page 217
7.8. Localizing Change
Page 220
7.9. Implicit Coupling
Page 220
7.10. Thinking Ahead
Page 224
7.11. Cohesion
Page 225
7.11.1. Cohesion Of Methods
Page 225
7.11.2. Cohesion Of Classes
Page 226
7.11.3. Cohesion For Readability
Page 227
7.11.4. Cohesion For Reuse
Page 227
7.12. Refactoring
Page 228
7.12.1. Refactoring And Testing
Page 229
7.12.2. An Example Of Refactoring
Page 229
7.13. Refactoring For Language Independence
Page 233
7.13.1. Enumerated Types
Page 233
7.13.2. Further Decoupling Of The Command Interface
Page 235
7.14. Design Guidelines
Page 237
7.15. Executing Without BlueJ
Page 238
7.15.1. Class Methods
Page 238
7.15.2. The Main Method
Page 239
7.15.3. Limitations Of Class Methods
Page 239
7.16. Summary
Page 240
Part 2. Application Structures
Page 243
Chapter 8. Improving Structure With Inheritance
Page 245
8.1. The Dome Example
Page 245
8.1.1. Dome Classes And Objects
Page 246
8.1.2. Dome Source Code
Page 249
8.1.3. Discussion Of The Dome Application
Page 255
8.2. Using Inheritance
Page 256
8.3. Inheritance Hierarchies
Page 257
8.4. Inheritance In Java
Page 258
8.4.1. Inheritance And Access Rights
Page 259
8.4.2. Inheritance And Initialization
Page 260
8.5. Dome: Adding Other Item Types
Page 262
8.6. Advantages Of Inheritance (So Far)
Page 264
8.7. Subtyping
Page 265
8.7.1. Subclasses And Subtypes
Page 266
8.7.2. Subtyping And Assignment
Page 267
8.7.3. Subtyping And Parameter Passing
Page 268
8.7.4. Polymorphic Variables
Page 269
8.7.5. Casting
Page 270
8.8. The Object Class
Page 271
8.9. Autoboxing And Wrapper Classes
Page 272
8.10. The Collection Hierarchy
Page 273
8.11. Summary
Page 273
Chapter 9. More About Inheritance
Page 276
9.1. The Problem: Dome's Print Method
Page 276
9.2. Static Type And Dynamic Type
Page 278
9.2.1. Calling Print From Database
Page 279
9.3. Overriding
Page 281
9.4. Dynamic Method Lookup
Page 282
9.5. Super Call In Methods
Page 285
9.6. Method Polymorphism
Page 287
9.7. Object Methods: ToString
Page 287
9.8. Object Equality: Equals And HashCode
Page 290
9.9. Protected Access
Page 292
9.10. The Instanceof Operator
Page 294
9.11. Another Example Of Inheritance With Overriding
Page 295
9.12. Summary
Page 297
Chapter 10. Further Abstraction Techniques
Page 300
10.1. Simulations
Page 300
10.2. The Foxes-And-Rabbits Simulation
Page 301
10.2.1. The Foxes-And-Rabbits Project
Page 302
10.2.2. The Rabbit Class
Page 305
10.2.3. The Fox Class
Page 308
10.2.4. The Simulator Class: Setup
Page 311
10.2.5. The Simulator Class: A Simulation Step
Page 314
10.2.6. Taking Steps To Improve The Simulation
Page 316
10.3. Abstract Classes
Page 316
10.3.1. The Animal Superclass
Page 317
10.3.2. Abstract Methods
Page 318
10.3.3. Abstract Classes
Page 320
10.4. More Abstract Methods
Page 322
10.5. Multiple Inheritance
Page 324
10.5.1. An Actor Class
Page 324
10.5.2. Flexibility Through Abstraction
Page 326
10.5.3. Selective Drawing
Page 326
10.5.4. Drawable Actors: Multiple Inheritance
Page 327
10.6. Interfaces
Page 328
10.6.1. An Actor Interface
Page 328
10.6.2. Multiple Inheritance Of Interfaces
Page 330
10.6.3. Interfaces As Types
Page 331
10.6.4. Interfaces As Specifications
Page 331
10.6.5. A Further Example Of Interfaces
Page 332
10.6.6. Abstract Class Or Interface?
Page 333
10.7. Summary Of Inheritance
Page 334
10.8. Summary
Page 334
Chapter 11. Building Graphical User Interfaces
Page 337
11.1. Introduction
Page 337
11.2. Components, Layout, And Event Handling
Page 338
11.3. AWT And Swing
Page 338
11.4. The ImageViewer Example
Page 339
11.4.1. First Experiments: Creating A Frame
Page 339
11.4.2. Adding Simple Components
Page 342
11.4.3. Adding Menus
Page 343
11.4.4. Event Handling
Page 344
11.4.5. Centralized Receipt Of Events
Page 345
11.4.6. Inner Classes
Page 348
11.4.7. Anonymous Inner Classes
Page 349
11.4.8. Summary Of Key GUI Elements
Page 351
11.5. ImageViewer 1.0: The First Complete Version
Page 351
11.5.1. Image-Processing Classes
Page 351
11.5.2. Adding The Image
Page 353
11.5.3. Layout
Page 354
11.5.4. Nested Containers
Page 356
11.5.5. Image Filters
Page 360
11.5.6. Dialogs
Page 363
11.5.7. Summary Of Layout Management
Page 364
11.6. ImageViewer 2.0: Improving Program Structure
Page 365
11.7. ImageViewer 3.0: More Interface Components
Page 370
11.7.1. Buttons
Page 370
11.7.2. Borders
Page 373
11.8. Further Extensions
Page 374
11.9. Another Example: SoundPlayer
Page 376
11.10. Summary
Page 379
Chapter 12. Handling Errors
Page 381
12.1. The Address-Book Project
Page 382
12.2. Defensive Programming
Page 386
12.2.1. Client-Server Interaction
Page 386
12.2.2. Argument Checking
Page 388
12.3. Server Error Reporting
Page 389
12.3.1. Notifying The User
Page 389
12.3.2. Notifying The Client Object
Page 390
12.4. Exception-Throwing Principles
Page 393
12.4.1. Throwing An Exception
Page 393
12.4.2. Exception Classes
Page 394
12.4.3. The Effect Of An Exception
Page 396
12.4.4. Unchecked Exceptions
Page 397
12.4.5. Preventing Object Creation
Page 398
12.5. Exception Handling
Page 399
12.5.1. Checked Exceptions: The Throws Clause
Page 399
12.5.2. Catching Exceptions: The Try Statement
Page 400
12.5.3. Throwing And Catching Multiple Exceptions
Page 402
12.5.4. Propagating An Exception
Page 404
12.5.5. The Finally Clause
Page 404
12.6. Defining New Exception Classes
Page 405
12.7. Using Assertions
Page 407
12.7.1. Internal Consistency Checks
Page 407
12.7.2. The Assert Statement
Page 407
12.7.3. Guidelines For Using Assertions
Page 409
12.7.4. Assertions And The BlueJ Unit Testing Framework
Page 410
12.8. Error Recovery And Avoidance
Page 410
12.8.1. Error Recovery
Page 410
12.8.2. Error Avoidance
Page 412
12.9. File-Based Input/Output
Page 413
12.9.1. Readers, Writers, And Streams
Page 414
12.9.2. Text Output With FileWriter
Page 414
12.9.3. Text Input With FileReader
Page 416
12.9.4. The File Class
Page 419
12.9.5. Scanner: Reading Input From The Terminal
Page 419
12.9.6. Object Serialization
Page 421
12.10. Summary
Page 422
Chapter 13. Designing Applications
Page 424
13.1. Analysis And Design
Page 424
13.1.1. The Verb/Noun Method
Page 425
13.1.2. The Cinema Booking Example
Page 425
13.1.3. Discovering Classes
Page 425
13.1.4. Using CRC Cards
Page 426
13.1.5. Scenarios
Page 427
13.2. Class Design
Page 431
13.2.1. Designing Class Interfaces
Page 431
13.2.2. User Interface Design
Page 432
13.3. Documentation
Page 432
13.4. Cooperation
Page 433
13.5. Prototyping
Page 434
13.6. Software Growth
Page 434
13.6.1. Waterfall Model
Page 434
13.6.2. Iterative Development
Page 435
13.7. Using Design Patterns
Page 436
13.7.1. Structure Of A Pattern
Page 437
13.7.2. Decorator
Page 437
13.7.3. Singleton
Page 438
13.7.4. Factory Method
Page 439
13.7.5. Observer
Page 439
13.7.6. Pattern Summary
Page 441
13.8. Summary
Page 442
Chapter 14. A Case Study
Page 444
14.1. The Case Study
Page 444
14.1.1. The Problem Description
Page 444
14.2. Analysis And Design
Page 445
14.2.1. Discovering Classes
Page 445
14.2.2. Using CRC Cards
Page 446
14.2.3. Scenarios
Page 447
14.3. Class Design
Page 449
14.3.1. Designing Class Interfaces
Page 449
14.3.2. Collaborators
Page 449
14.3.3. The Outline Implementation
Page 450
14.3.4. Testing
Page 454
14.3.5. Some Remaining Issues
Page 455
14.4. Iterative Development
Page 455
14.4.1. Development Steps
Page 455
14.4.2. A First Stage
Page 456
14.4.3. Testing The First Stage
Page 460
14.4.4. A Later Stage Of Development
Page 461
14.4.5. Further Ideas For Development
Page 462
14.4.6. Reuse
Page 463
14.5. Another Example
Page 463
14.6. Taking Things Further
Page 464
Appendices
A. Working With A BlueJ Project
Page 465
B. Java Data Types
Page 468
C. Operators
Page 471
D. Java Control Structures
Page 474
E. Running Java Without BlueJ
Page 480
F. Using The Debugger
Page 483
G. JUnit Unit-Testing Tools
Page 487
H. Teamwork Tools
Page 489
I. Javadoc
Page 491
J. Program Style Guide
Page 494
K. Important Library Classes
Page 498
Index
Page 502

Edition Notes

Includes bibliographical references and index.

Published in
Upper Saddle River, N.J

Classifications

Dewey Decimal Class
005.1/17
Library of Congress
QA76.64 .B385 2009

The Physical Object

Pagination
p. cm.
Number of pages
560

Edition Identifiers

Open Library
OL16901033M
ISBN 10
0136060862
ISBN 13
9780136060864
LCCN
2008024950
LibraryThing
336884
Goodreads
5165502

Work Identifiers

Work ID
OL11967463W

Community Reviews (0)

No community reviews have been submitted for this work.

Lists

History

Download catalog record: RDF / JSON / OPDS | Wikipedia citation
September 14, 2025 Edited by Drini Add TOC from Tocky
December 19, 2023 Edited by ImportBot import existing book
January 15, 2023 Edited by ImportBot import existing book
January 15, 2023 Edited by ImportBot import existing book
September 26, 2008 Created by ImportBot Imported from Library of Congress MARC record